Path With Minimum Effort (Dijkstra)

Medium · Graphs · about 25 minutes

Asked at Google, Amazon, Uber.

heights is a grid of elevations. A hiker goes from the top-left cell to the bottom-right cell, stepping between cells that share a side. A route is as tiring as its single biggest elevation change between two consecutive cells. Find the least tiring route and return that biggest change.

Related guides