Problem statement
You are given two strings of the same length and asked whether one consistent rename of letters turns the first into the second.
A letter may be renamed to any other letter, but the same letter must always get the same replacement, and two letters may not share one.
Examples
Inputs = "egg", t = "add"
Outputtrue
e becomes a and g becomes d, in both places.
Inputs = "foo", t = "bar"
Outputfalse
o would have to stand for both a and r.
The walkthrough is part of Premium
The statement and the examples above stay free. The full how-to-solve walkthrough, the cost notes in plain words and the interactive step-by-step visualizer unlock with a Premium plan.
See pricing