#!/usr/bin/python
# coding: utf-8

class Solution(object):
    def isIsomorphic(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        if len(s) != len(t):
            return False
        m1 = [0] * 256
        m2 = [0] * 256
        for i in range(len(s)):
            if m1[ord(s[i])] != m2[ord(t[i])]:
                return False
            m1[ord(s[i])], m2[ord(t[i])] = i + 1, i + 1
        return True
