Back to Browse

Check if two given strings are isomorphic to each other - Solution in JAVA

774 views
Jun 3, 2022
12:01

Two strings str1 and str2 are called isomorphic if there is a one-to-one mapping possible for every character of str1 to every character of str2. And all occurrences of every character in ‘str1’ map to the same character in ‘str2’. Examples: Input: str1 = "aab", str2 = "xxy" Output: True 'a' is mapped to 'x' and 'b' is mapped to 'y'. Input: str1 = "aab", str2 = "xyz" Output: False One occurrence of 'a' in str1 has 'x' in str2 and other occurrence of 'a' has 'y'. Practice links: https://leetcode.com/problems/isomorphic-strings/ https://practice.geeksforgeeks.org/problems/isomorphic-strings-1587115620/1

Download

1 formats

Video Formats

360pmp415.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Check if two given strings are isomorphic to each other - Solution in JAVA | NatokHD