← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given two strings s and t, determine whether they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t, with a one-to-one mapping, while preserving the order of characters.
Example 1:
Input: s = "egg", t = "add" Output: true
Example 2:
Input: s = "foo", t = "bar" Output: false
Example 3:
Input: s = "paper", t = "title" Output: true
Constraints:
1 <= s.length <= 105t.length == s.lengths and t consist of any valid ASCII character.Hint:
You can utilize a mapping of characters from s to t. If any character maps to more than one character in t, or if the mapping is not consistent, return false.