###### 205. 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.

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.

1.我的答案

class Solution {
public:
bool isIsomorphic(string s, string t) {
vector<int> v1(256,0);
vector<int> v2(256,0);
for(int i = 0; i < s.size(); i++){
if(v1[s[i]] != v2[t[i]])
return false;
v1[s[i]] = i+1;
v2[t[i]] = i+1;
}
return true;
}
};

#### Leetcode 205. Isomorphic Strings

2017-02-09 07:58:51

#### 【LeetCode】205 Isomorphic Strings （c++实现）

2015-07-22 10:29:55

#### LeetCode OJ 205 Isomorphic Strings

2015-05-03 13:49:11

#### LeetCode 205. Isomorphic Strings（C++版）

2017-03-31 10:54:17

#### 同构字符串

2015-08-06 22:02:21

#### 205. Isomorphic Strings [easy] (Python)

2016-06-15 14:02:47

#### leetcode 205: Isomorphic Strings

2015-04-30 04:54:59

#### Leetcode_205_Isomorphic Strings

2015-06-17 10:27:44

#### LeetCode 205:Isomorphic Strings

2015-05-08 23:06:25

#### 【LeetCode-面试算法经典-Java实现】【205-Isomorphic Strings（同构字符串）】

2015-08-27 06:33:32

## 不良信息举报

205. Isomorphic Strings