Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Minimum Effort Grid Path
00:00
5 left

Minimum Effort Grid Path

HardPython

Problem

Given a grid of heights, return the minimum possible effort needed to move from the top-left cell to the bottom-right cell. The effort of a path is the maximum absolute difference between adjacent cells along that path, and movement is allowed in four directions.

Constraints

  • 1 <= m, n <= 100
  • 1 <= heights[i][j] <= 10^6
  • Move only up, down, left, or right
Interviewer

Your question is Minimum Effort Grid Path. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.