Easy · Strings
Is isomorphic
Given two ASCII strings s and t of the same length, return true if the characters of s can be replaced to produce t, with every occurrence of a character replaced by the same character and no two characters replaced by the same one (a character may map to itself), and false otherwise.
Examples
Example 1
{
"s": "egg",
"t": "add"
}Output: true (isomorphic)
Example 2
{
"s": "foo",
"t": "bar"
}Output: false (not isomorphic)
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.