Isomorphic Strings

Practice this coding question on Coding Gurukul.

Problem statement

Two labels use different alphabets. Decide whether replacing each distinct character in the first label with exactly one character produces the second label. Different original characters must map to different replacements, and the mapping must remain consistent at every position.

Input format

Two lines: strings s and t of equal length.

Output format

Print true or false in lowercase.

Constraints

1 <= length <= 50000; strings contain lowercase English letters.

Sample input

paper
title

Sample output

true

Sign in to run or submit a solution in C++, Java or Python.