We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ee888d commit 19b62b4Copy full SHA for 19b62b4
MEDIUM/src/medium/UniquePaths.java
@@ -36,7 +36,7 @@ public int uniquePaths_merged_for_loop(int m, int n) {
36
int[][] dp = new int[m][n];
37
for(int i = 0; i < m; i++){
38
for(int j = 0; j < n; j++){
39
- if(i == 0 || j == 0) dp[i][j] = 0;
+ if(i == 0 || j == 0) dp[i][j] = 1;
40
else dp[i][j] = dp[i-1][j] + dp[i][j-1];
41
}
42
0 commit comments