Isomorphic strings
Easystringhash map
Return true if you can replace each letter of s with a fixed letter to get t: a letter always maps to the same letter, and two different letters never map to the same one.
Example 1
Input: s = "egg", t = "add" Output: true
Example 2
Input: s = "foo", t = "bar" Output: false
Example 3
Input: s = "badc", t = "baba" Output: false
Both b and d would map to b.
Constraints
- 1 ≤ s.length ≤ 5·10⁴
- t.length == s.length
- Printable ASCII characters
Submit checks your solution against 10 tests, including hidden ones.
/**
* @param {string} s
* @param {string} t
* @return {bool}
*/
function isIsomorphic(s, t) {
}