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 challengesIsomorphic Codes

Gamified challenge · Hash maps

Isomorphic Codes

Two codes a and b (lowercase letters) are isomorphic if you can replace every letter of a by a letter so that a becomes b, where the same letter always becomes the same letter and no two different letters become the same letter. A letter may map to itself.

Write isomorphic(a, b) that returns true if such a one-to-one letter swap exists, else false. Codes of different lengths never match; two empty codes do.

Examples: egg and add match (e→a, g→d). foo and bar don't (o would need to be both a and r). ab and aa don't either: a and b can't both become a.

Sign in to play Isomorphic Codes

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