```
def isIsomorphic(self, s, t):
if len(s) != len(t):
return False
def halfIsom(s, t):
res = {}
for i in xrange(len(s)):
if s[i] not in res:
res[s[i]] = t[i]
elif res[s[i]] != t[i]:
return False
return True
return halfIsom(s, t) and halfIsom(t, s)
```