Skip to content

Commit 4958f18

Browse files
authored
Update 03 - Bottom-Up | DP | Approach.cpp
1 parent bbce4fb commit 4958f18

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

24 - Dynamic Programming Problems/32 - Best Time To Buy and Sell Stock II/03 - Bottom-Up | DP | Approach.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ class Solution {
1111
// - `buy` represents whether buying (1) or selling (0) is allowed on this day
1212
vector<vector<int>> dp(n + 1, vector<int>(2, 0));
1313

14-
// Base cases: No profit can be made after the last day
15-
dp[n][0] = 0; // No stock in hand, no profit
16-
dp[n][1] = 0; // Stock in hand, no profit
17-
1814
// Iterate backward from the second last day to the first day
1915
for (int index = n - 1; index >= 0; index--) {
2016
// Iterate over the two states: buy (1) and sell (0)

0 commit comments

Comments
 (0)