```
class Solution {
public:
bool isIsomorphic(string s, string t) {
int len = s.size(), i = 0;
int smap[256] = {0};
int tmap[256] = {0};
for (i = 0; i < len; ++i)
{
//let s[i] and t[i] map to the same number i+1
if (smap[s[i]] == 0)
smap[s[i]] = i + 1;
if (tmap[t[i]] == 0)
tmap[t[i]] = i + 1;
if (smap[s[i]] != tmap[t[i]])
return false;
}
return true;
}
};
```