Longest Increasing Path in a Matrix

Hard · Dynamic Programming · about 30 minutes

Asked at Google, DoorDash, Meta, Amazon, Microsoft, Bloomberg.

Moving between cells of matrix that share a side, find the longest route along which every step goes to a strictly larger value, and return how many cells it visits.

Related guides