Skip to content

Commit 27477fa

Browse files
committed
Runtime: 62 ms (Top 95.54%) | Memory: 42.3 MB (Top 53.45%)
1 parent bf100c9 commit 27477fa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
// Runtime: 62 ms (Top 95.54%) | Memory: 42.3 MB (Top 53.45%)
12
var uniquePaths = function(m, n) {
23
let count = Array(m)
3-
for(let i=0; i<m; i++) count[i] = Array(n)
4+
for(let i=0; i<m; i++) count[i] = Array(n)
45
for(let i=0; i<m; i++){
56
for(let j=0; j<n; j++){
6-
if(i == 0 || j == 0) count[i][j] = 1
7-
else count[i][j] = count[i][j-1] + count[i-1][j]
7+
if(i == 0 || j == 0) count[i][j] = 1
8+
else count[i][j] = count[i][j-1] + count[i-1][j]
89
}
910
}
1011
return count[m-1][n-1]
11-
};
12+
};

0 commit comments

Comments
 (0)