Code Room
CodingHard
Question
You are given an m x n grid of non-negative integer heights. Starting at (0,0) and ending at (m-1,n-1), moving 4-directionally, the 'effort' of a path is the maximum absolute height difference between any two consecutive cells on that path. Return the minimum possible effort over all paths. The grid has at least one cell.
Implement
min_effort_path(heights: list[list[int]]) → intExamples
in
[[[1,2,2],[3,8,2],[5,3,5]]]out2What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Learn the concepts
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.
Run or narrate your approach, then ask the coach.