#50

LeetCode:Isomorphic Strings

一世执手 提交于 2020-04-12 12:15:23
1、题目名称 Isomorphic Strings(同构的字符串) 2、题目地址 https://leetcode.com/problems/isomorphic-strings/ 3、题目内容 英文: 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. 中文: 给出两个字符串s和t,确定它们是否同构。两个字符串是同构的充要条件是它们之间相同位置的字符存在一一对应关系可以相互替换。在字符串s中不存在两个不同的字符映射到t中同一个字符的情况,但一个字符可以映射到它自身。 例如:egg和add是同构的,foo和bar不是同构的,paper和title是同构的 4、解题方法1