Company: Sprinkler_1oct
Difficulty: medium
String Transformation A letter substitution assigns to every lowercase letter exactly one replacement letter. It must be one-to-one : two different letters may never be given the same replacement. A letter is allowed to be replaced by itself. Applying a substitution to a string replaces every character by its assigned replacement at the same time, so the length and the positions of the characters do not change. You are given two strings S and T of equal length. Decide whether some letter substitution turns S into exactly T . Answer this question independently for each of several test cases. Input Format The first line contains an integer N , the number of test cases. Each test case consists of two lines: the first contains the string S and the second contains the string T . Output Format For each test case print true if a one-to-one letter substitution turns S into T , and false otherwise, each on its own line. The words must be lowercase. Constraints 1 <= N <= 10 1 <= |S| = |