题目
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.
For example,
Given “egg”, “add”, return true.
Given “foo”, “bar”, return false.
Given “paper”, “title”, return true.
Note:
You may assume both s and t have the same length.
翻译
给定两个字符串s and t,判断它们是否是同构字符串。
同构字符串是指,s 中的字符可以被替换以得到 t。
字符串中同一个字符的所有出现位置必须被相同的字符替换,并且不改变其在原始字符串中的位置。不同的字符不能够被映射到相同的字符,