| 36 | |
| 37 | """ |
| 38 | class Solution(object): |
| 39 | def minFallingPathSum(self, A): |
| 40 | """ |
| 41 | :type A: List[List[int]] |
| 42 | :rtype: int |
| 43 | """ |
| 44 | |
| 45 | for y in range(1, len(A)): |
| 46 | for x in range(len(A[0])): |
| 47 | a = A[y-1][x-1] if x-1 >= 0 else float('inf') |
| 48 | b = A[y-1][x+1] if x+1 < len(A[0]) else float('inf') |
| 49 | |
| 50 | A[y][x] += min(A[y-1][x], a, b) |
| 51 | |
| 52 | return min(A[-1]) |
nothing calls this directly
no outgoing calls
no test coverage detected