Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Path With Minimum Effort

In a grid of heights, the effort of a path is the maximum absolute height difference between two consecutive cells on it. Print the minimum effort needed to travel from the top-left to the bottom-right cell (moves are up, down, left, right).

Constraints

1 <= R, C <= 100 1 <= height <= 10^6

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.