Skip to content
Prev Previous commit
Next Next commit
Fixed sonar
  • Loading branch information
javadev committed Jun 8, 2025
commit b70e36a764f8934c47f2c9e4dadb03e014efe556
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ private long f(int i, int k, int state) {
profit = Math.max(profit, f(i + 1, k - 1, 0) - p);
}
}
return dp[i][k][state] = profit;
dp[i][k][state] = profit;
return profit;
}

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