#K83867. Isomorphic Strings
Isomorphic Strings
Isomorphic Strings
You are given two strings s and t. Two strings are isomorphic if the characters in s can be replaced to get t with a one-to-one mapping between characters. In other words, no two characters may map to the same character, but a character may map to itself.
Formally, given two strings \(s\) and \(t\) with \(|s| = |t|\), they are isomorphic if there exists a bijection \(f: \Sigma \to \Sigma\) such that for every \(i\) (with \(1 \leq i \leq |s|\)), \(f(s_i) = t_i\).
Your task is to determine if the two given strings are isomorphic.
inputFormat
The input consists of two lines. The first line contains the string s
and the second line contains the string t
.
outputFormat
Print True
if the strings are isomorphic and False
otherwise.
egg
add
True