We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 749eb24 commit 628ce16Copy full SHA for 628ce16
C++/minimum-array-sum.cpp
@@ -19,7 +19,7 @@ class Solution {
19
}
20
if (i - 1 >= 0 && j - 1 >= 0) {
21
if (x - k >= 0) {
22
- dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] - x + (((x - k) + 1) / 2));
+ dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] - x + ((x - k) + 1) / 2);
23
24
if ((x + 1) / 2 - k >= 0) {
25
dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] - x + ((x + 1) / 2 - k));
0 commit comments