← 返回 uber 的题目列表Isomorphic Strings
类型:qbank
Given two strings s and t, determine whether they are isomorphic via a one-to-one character mapping that preserves order.
Isomorphic Strings
Given two strings s and t, determine whether they are isomorphic via a one-to-one character mapping that preserves order.
SWE
string
hashmap
easy
Frequency
Single report
Last asked
2026-01-03
Stage
phone-screen
Isomorphic Strings
Given two strings s and t, determine whether they are isomorphic.
Two strings are isomorphic when characters from s can be replaced to form t with a one-to-one mapping, while preserving the order of characters.
Examples
Example 1:
Input: s = "egg", t = "add"
Output: true
Example 2:
Input: s = "foo", t = "bar"
Output: false
Constraints
1 <= s.length <= 5 * 10^4
t.length == s.length
s and t consist of any valid ASCII characters.