Skip to main content
Easy Hash Map / Set Medium frequency

Isomorphic Strings

Open on LeetCode

Approach Summary

Maintain two maps: s-char → t-char and t-char → s-char. Conflict in either direction → not isomorphic.

How to Recognize This Pattern

  • "Can s be transformed to t by replacing chars consistently"
  • Bijection: both directions must be consistent

Complexity Analysis

Time Complexity

O(n)

Space Complexity

O(1)

Tags

Hash Table String

This site is free. If these guides are helping your prep, consider buying me a coffee. ☕

Support →
Buy me a coffee