We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8df3723 commit 7ac394bCopy full SHA for 7ac394b
README.md
@@ -42,6 +42,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr
42
|55|[Jump Game](https://leetcode.com/problems/jump-game/) <sup>*</sup> | [JavaScript](./src/jump-game/res.js)|Medium|
43
|56|[Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js)|Medium|
44
|57|[Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js)|Hard|
45
+|62|[Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js)|Medium|
46
|66|[Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js)|Easy|
47
|69|[Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js)|Easy|
48
|71|[Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js)|Medium|
src/unique-paths/res.js
@@ -0,0 +1,20 @@
1
+/**
2
+ * @param {number} m
3
+ * @param {number} n
4
+ * @return {number}
5
+ */
6
+var uniquePaths = function(m, n) {
7
+ const list = [];
8
+ for (let i = 0; i < n; i++) {
9
+ list.push([]);
10
+ for (let j = 0; j < m; j++) {
11
+ if (i === 0 || j === 0) {
12
+ list[i][j] = 1;
13
+ } else {
14
+ list[i][j] = Math.max(list[i-1][j] + list[i][j-1]);
15
+ }
16
17
18
+
19
+ return list[n-1][m-1];
20
+};
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments