Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself.
Example 1
Input: s = egg, t = add
Output: true
Explanation: Map e → a and g → d. Every e becomes a and every g becomes d, turning "egg" into "add".
Example 2
Input: s = foo, t = bar
Output: false
Explanation: The two 'o's in "foo" would have to become both 'a' and 'r', but a character can only map to one other character.
Example 3
Input: s = paper, t = title
Output: true
Explanation: Map p → t, a → i, e → l and r → e. Applying it to "paper" gives "title", and no two letters share a target.
Walk both strings together, building a consistent letter-to-letter mapping in each direction. If a character ever needs to map to two different things — or two characters collide onto the same target — they aren't isomorphic.
Run checks all cases above. Submit evaluates all test cases.