Find the maximum path length in a grid under height-based move and jump rules.
Unlock detailed company stats for this questionUpgrade
Given a 2D matrix of integers, find the maximum path length from any cell. Moving from cell A to cell B requires height(B) <= height(A). For a sequence X -> A -> B -> C, either height(C) <= height(B), or a 'jump up' is allowed when height(C) > height(B) and height(C) <= height(A). A cell cannot be revisited. Jump-ups can be used any number of times, but the first two elements of the sequence must satisfy height(element 1) >= height(element 2).
Format · Technical interview.
Community answers
No answers contributed by the community yet.


