Problem 1153 · Hard

String Transforms Into Another String

Build the letter-to-letter mapping from str1 to str2; a letter that needs two targets fails, and a spare letter is needed when every letter is in use.

Open the interactive visualisation