Verizon OA 2024 | Path With Minimum Effort (Dijkstra's Algorithm) | Java Solution
Question · Posted Jun 2026
Problem Statement You are given an m x n grid called heights, where heights[row][col] represents the height of a cell. You need to find a path from the top-left cell (0,0) to the bottom-right cell (m-1,n-1). The effort of a path is defined as the maximum absolute difference in heights between two consecutive cells along the path. Return the minimum effort required to travel from the top-left cell to the bottom-right cell. Example 1 Input heights = [ [1,2,2], [3,8,2], ...
The full answer & interview discussion are available to premium members.
Log in Create a free account