Skip to content

Commit

Permalink
Update burst-balloons.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed Nov 30, 2015
1 parent 5f3d1bc commit 9630088
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions C++/burst-balloons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class Solution {
vector<vector<int>> max_coins(coins.size(), vector<int>(coins.size()));
for (int k = 2; k < coins.size(); ++k) {
for (int left = 0; left < coins.size() - k; ++left) {
const int right = left + k;
for (int i = left + 1; i < right; ++i) {
for (int i = left + 1, right = left + k; i < right; ++i) {
max_coins[left][right] = max(max_coins[left][right],
coins[left] * coins[i] * coins[right] +
max_coins[left][i] + max_coins[i][right]);
Expand Down

0 comments on commit 9630088

Please sign in to comment.