Skip to content

Commit d6fc8f1

Browse files
committed
no message
1 parent 6172cd8 commit d6fc8f1

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
import Foundation
2-
2+
class Solution {
3+
func minimumEffortPath(_ heights: [[Int]]) -> Int {
4+
guard !heights.isEmpty, !heights[0].isEmpty else {
5+
return 0
6+
}
7+
var heights = heights
8+
var minEffort = heights[0][0]
9+
var queue = Array([0,0])
10+
while !queue.isEmpty {
11+
var currentCell = queue.removeFirst()
12+
var (currentX, currentY) = (currentCell[0], currentCell[1])
13+
var currentMinEffort = heights[currentX][currentY]
14+
var currentLevelSize = queue.count
15+
16+
for _ in 0..<currentLevelSize {
17+
18+
}
19+
minEffort = max(minEffort, currentMinEffort)
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)