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 bcd0e26 commit 82bdeadCopy full SHA for 82bdead
unique-paths/delight010.swift
@@ -0,0 +1,13 @@
1
+class Solution {
2
+ func uniquePaths(_ m: Int, _ n: Int) -> Int {
3
+ let column = Array(repeating: 1, count: n)
4
+ var grid: [[Int]] = Array(repeating: column, count: m)
5
+ for i in 1..<m {
6
+ for j in 1..<n {
7
+ grid[i][j] = grid[i - 1][j] + grid[i][j - 1]
8
+ }
9
10
+ return grid.last!.last!
11
12
+}
13
+
0 commit comments