GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesHiking Effort Map

Gamified challenge · Dijkstra with a custom cost

Hiking Effort Map

heights[r][c] is the height of the ground at row r, column c. You start at the top-left cell and must reach the bottom-right cell, moving up, down, left or right one cell at a time.

A step's effort is the absolute height difference between the two cells, and a route's effort is its largest single step. Write minEffort(heights) that returns the smallest effort of any route. A 1×1 map needs no steps: 0.

Example: [[1,2,2],[3,8,2],[5,3,5]] answers 2: the route 1 → 3 → 5 → 3 → 5 down the left side and along the bottom never changes height by more than 2.

Sign in to play Hiking Effort Map

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account