#C2144. Isomorphic Strings Check
Isomorphic Strings Check
Isomorphic Strings Check
You are given two strings s1 and s2. Your task is to determine whether the two strings are isomorphic. Two strings are isomorphic if there is a one-to-one mapping between every character of s1 and every character of s2.
Formally, there exists a bijection f: Σ → Σ such that for every index i,
\( f(s_{1}[i]) = s_{2}[i] \).
Note: The empty strings are isomorphic.
inputFormat
The input is read from stdin as follows:
- The first line contains an integer T, the number of test cases.
- Then, for each test case, there are two lines: the first line contains the string s1 and the second line contains the string s2. These strings may be empty.
outputFormat
For each test case, output a single line to stdout containing Yes
if the two strings are isomorphic, otherwise output No
.
3
egg
add
foo
bar
paper
title
Yes
No
Yes
</p>