DIY: String Transforms into Another String
Solve the interview question "String Transforms into Another String" yourself in this lesson.
We'll cover the following
Given two strings of the same length
str2, determine whether you can transform
str2 by doing zero or more conversions.
Note: In one conversion you can convert all occurrences of one character in
str1to any other lowercase English character.
Return true if and only if you can transform
The input will be two strings. The following is an example input:
inputs = ("aabcc", "ccdee")
The output will be a Boolean value. The following is an example output:
canConvert(str1, str2) function, where
str1 is the string that needs to be converted to
str2. The function returns
false depending on whether the conversion is possible.