Google | Onsite 2019 | Matrix Shortest Path (with constraints)
Anonymous User
339

Given a NxM matrix, with each element in the grid holding a wait time from 0 to 10, what's the minimum time from the bottom left of the matrix to the top right of the matrix? You can only move up or right.
e.g.
[[4,6,9,8]]
[[1,0,2,7]]
[[0,2,0,0]]
return 17 because:
from bottom to top, 0+2+0+0+7+8=17

Comments (3)