Check Similar Passwords (Also for Fungile)
Amazon would like to enforce a password policy that when a user changes their password,
the new password cannot be similar to the current one. To determine whether two passwords are similar,
they take the new password, choose a set of indices and change the characters at these indices
to the next cyclic character exactly once. Character 'a' is changed to "b",
'b' to 'c' and so on, and 'z' changes to 'a'. The password
is said to be similar if after applying the operation, the old password is a subsequence of the new password.
The developers come up with a set of n password change requests, where
newPasswords denotes the array of new passwords and oldPasswords
denotes the array of old passwords. For each pair newPasswords[i] and oldPassword[i], return
"YES" if the passwords are similar, that is newPasswords[i] becomes a subsequence
of oldPasswords[i] after performing the operations, and "NO" otherwise.
Note
A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements.
Complete the function checkSimilarPasswords in the editor.
checkSimilarPasswords has the following parameters:
string newPasswords[n]: newPasswords[i] represents the new password of the ith pairstring oldPasswords[n]: newPasswords[i] represents the old password of the ith pairReturns
string[n]: the ith string represents the answer to the ith pair of passwords.
1Example 1
2Example 2

Constraints
Limits and guarantees your solution can rely on.
1 <= n <= 10Sum of lengths of all passwords in array newPassword and array oldPasswords does not exceed (2 * 105)|oldPasswords[i] <= |newPasswords[i]| for all i