0
点赞
收藏
分享

微信扫一扫

Java中的服务化架构设计与实现

小黑Neo 2024-07-24 阅读 9

题目:

题解:

class Solution:
    def isIsomorphic(self, s: str, t: str) -> bool:
        dicts = Counter(s)
        dictt = Counter(t)        
        if list(dicts.values()) != list(dictt.values()):
            return False
    
        for i in range(len(s)):
            inds = list(dicts.keys()).index(s[i])
            if list(dictt.keys())[inds] != t[i]:
                return False
        return True
举报

相关推荐

0 条评论