Repeated Queries for a Strictly Increasing Path from the Top-Left Cell

Given an m × n integer matrix grid, you may move from a cell to one of its four neighbors, but the next cell's value must be strictly greater than the current cell's value.

The start is fixed...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: