#K3966. Isomorphic Strings
Isomorphic Strings
Isomorphic Strings
Given two strings, determine if they are isomorphic. Two strings A and B are isomorphic if the characters in A can be replaced to get B, with each character mapping to a unique character in B and vice versa. Formally, for every character a in A and corresponding character b in B, there exists a bijective mapping between the characters. In other words, the strings must have the same length, and if A[i] = A[j] then B[i] must equal B[j], and conversely.
Your task is to read two strings from the standard input and output True
if they are isomorphic, otherwise output False
.
inputFormat
The input consists of two lines:
- The first line contains the string A.
- The second line contains the string B.
outputFormat
Output a single line: True
if the two strings are isomorphic, or False
otherwise.
egg
add
True