205. Isomorphic Strings python

Given two strings s and t, determine whether they are isomorphic.

A string s and t are said to be isomorphic if the string s can be obtained by character substitution to obtain a string t.

class Solution(object):
    def isIsomorphic(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        return map(s.find,s) == map(t.find,t)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324692091&siteId=291194637