LC version: https://leetcode.com/problems/string-transforms-into-another-string (premium)
Given 2 strings s and t, determine if you can convert s into t. The rules are:
Example 1:
Input: s = "abca", t = "dced"
Output: true
Explanation: abca ('a' to 'd') -> dbcd ('c' to 'e') -> dbed ('b' to 'c') -> dcedExample 2:
Input: s = "ab", t = "ba"
Output: true
Explanation: ab -> ac -> bc -> baExample 3:
Input: s = "abcdefghijklmnopqrstuvwxyz", t = "bcdefghijklmnopqrstuvwxyza"
Output: falseExample 4:
Input: s = "aa", t = "cd"
Output: falseExample 5:
Input: s = "ab", t = "aa"
Output: trueExample 6:
Input: s = "abcdefghijklmnopqrstuvwxyz", t = "bbcdefghijklmnopqrstuvwxyz"
Output: trueBoth strings contain only lowercase English letters.