Isomorphic strings Problem

Isomorphic strings Problem — ExecCode Medium DSA Practice

Solve the Isomorphic strings problem on ExecCode. Free online medium DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t, where every occurrence of a character must map to the same character, no two characters map to the same character, and order is preserved.

Examples

Input s = "paper", t = "title"; Output true. Input s = "egg", t = "add"; Output true. Input s = "foo", t = "bar"; Output false

Constraints

1 ≤ s.length ≤ 5 × 10⁴ t.length == s.length s and t consist of any valid ASCII character

Practice Isomorphic strings free on ExecCode. Browse DSA problems, topic map, and placement guides.