Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 1.87 KB

0205-isomorphic-strings.adoc

File metadata and controls

74 lines (53 loc) · 1.87 KB

205. Isomorphic Strings

{leetcode}/problems/isomorphic-strings/[LeetCode - Isomorphic Strings^]

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.

All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character but a character may map to itself.

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

Note:

You may assume both *_s _*and *_t _*have the same length.

思路分析

{image_attr}

检查是否为一一映射。

一刷
link:{sourcedir}/_0205_IsomorphicStrings.java[role=include]