Steward
分享是一種喜悅、更是一種幸福
程式語言 - LeetCode - C++ - 205. Isomorphic Strings
參考資訊:
https://www.cnblogs.com/grandyang/p/4465779.html
題目:

解答:
class Solution {
public:
bool isIsomorphic(string s, string t) {
int c1[255] = { 0 };
int c2[255] = { 0 };
for (int i = 0; i < s.size(); ++i) {
if (c1[s[i]] != c2[t[i]]) {
return false;
}
c1[s[i]] = i + 1;
c2[t[i]] = i + 1;
}
return true;
}
};