Substitute two equal letters by the next letter of the alphabet (two letters convert to one):
"aa" => "b", "bb" => "c", .. "zz" => "a".
The equal letters do not have to be adjacent.
Repeat this operation until there are no possible substitutions left.
Return a string.
Example:
let str = "zzzab"
str = "azab"
str = "bzb"
str = "cz"
return "cz"
- The order of letters in the result is not important.
- The letters
"zz"
transform into"a"
. - There will only be lowercase letters.