Problem
Two strings s and t are isomorphic if you can replace characters in s to get t, where every occurrence of a character is replaced by the same character, and **no two different characters map to the same character**. A character may map to itself. Return true if s and t are isomorphic.
Example 1
- Input
- s = "egg", t = "add"
- Output
- true
- Why
- e→a, g→d
Example 2
- Input
- s = "foo", t = "bar"
- Output
- false
- Why
- o would need to become both a and r
Example 3
- Input
- s = "badc", t = "baba"
- Output
- false
- Why
- b and d would both become b
Constraints
1 <= s.length <= 5 * 10^4t.length == s.lengths and t consist of any valid ASCII characters.