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 challengesTeleporter Maze

Gamified challenge · 0-1 BFS

Teleporter Maze

Each row of maze is a string: # is a wall, . is floor, S is where you start and E is the exit. A lowercase letter is a teleporter pad; it is floor too, and every pad with the same letter is linked.

Walking up, down, left or right onto any non-wall cell costs 1. Standing on a pad, you may teleport to any other pad with the same letter for 0. Write cheapestRoute(maze) that returns the cheapest total cost from S to E, or -1 if the exit can't be reached.

Example: in ["S.a#...", ".###.#.", "...#.aE"] walk two steps to the a pad, teleport to the other a, and step onto E: cost 3.

Sign in to play Teleporter Maze

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