Approach hintTry it first, then revealHide
Maintain two maps, one from characters of s to t and one in the reverse direction. A pair (s[i], t[i]) that contradicts either map means the mapping is not one-to-one.
Maintain two maps, one from characters of s to t and one in the reverse direction. A pair (s[i], t[i]) that contradicts either map means the mapping is not one-to-one.