Isomorphic Strings
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Two strings s and t are called **isomorphic** if the characters in s can be replaced to produce t.
Every occurrence of a character must be mapped to a single other character while keeping the order of characters the same. Two different characters in s may **not** map to the same character in t, but a character is always allowed to map to itself.
Given two strings s and t, return true if they are isomorphic, and false otherwise.
In other words, the mapping between the characters of s and t must be a **bijection**: each character of s maps to exactly one character of t, and no two distinct characters of s share the same image.
Examples
Constraints
- `1 <= s.length <= 5 * 10^4`
- `t.length == s.length`
- `s` and `t` consist of any valid ASCII characters.
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.