Isomorphic Strings
CodingPhone ScreenSoftware EngineerReported Sep, 2025
Examples
Example 1:
Input: s = "egg", t = "add"
Output: true
Example 2:
Input: s = "foo", t = "bar"
Output: false
Example 1:
Input: s = "egg", t = "add"
Output: true
Example 2:
Input: s = "foo", t = "bar"
Output: false
Given two strings s and t, determine whether they are isomorphic.
Two strings are isomorphic when characters from s can be replaced to form t with a one-to-one mapping, while preserving the order of characters.
1 <= s.length <= 5 * 10^4t.length == s.lengths and t consist of any valid ASCII characters.Reported as LeetCode 205 in a software engineer phone screen.