#K74977. Taco Transformation
Taco Transformation
Taco Transformation
You are given two strings (S_1) and (S_2). Your task is to determine whether (S_1) can be transformed into (S_2) by shifting each character in (S_1) by exactly one position forward in the alphabet in a cyclic manner. In other words, for every index (i) the following equation must hold:
[ S_2[i] = (S_1[i] + 1) \mod 26 ]
If the above condition is satisfied for every position, print "YES"; otherwise, print "NO". This problem tests your understanding of basic character operations and modular arithmetic.
inputFormat
The input is given via standard input (stdin). The first line contains an integer (T), the number of test cases. Each of the following (T) lines contains two space-separated strings (S_1) and (S_2) of equal length.
outputFormat
For each test case, output a single line containing "YES" if (S_1) can be transformed into (S_2) using the defined operation; otherwise, output "NO".## sample
6
abc bcd
xyz yza
abc def
aaa bbb
zzz aaa
abcdefghijklmnopqrstuvwxy bcdefghijklmnopqrstuvwxyz
YES
YES
NO
YES
YES
YES
</p>