Skip to content

Commit b70e36a

Browse files
committed
Fixed sonar
1 parent e0edca5 commit b70e36a

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/g3501_3600/s3573_best_time_to_buy_and_sell_stock_v

1 file changed

+2
-1
lines changed

src/main/java/g3501_3600/s3573_best_time_to_buy_and_sell_stock_v/Solution.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ private long f(int i, int k, int state) {
2929
profit = Math.max(profit, f(i + 1, k - 1, 0) - p);
3030
}
3131
}
32-
return dp[i][k][state] = profit;
32+
dp[i][k][state] = profit;
33+
return profit;
3334
}
3435

3536
public long maximumProfit(int[] prices, int k) {

0 commit comments

Comments
 (0)