您的位置:首页 > Web前端

389. Find the Difference

2017-06-09 18:48 295 查看
class Solution(object):

    def findTheDifference(self, s, t):

        """

        :type s: str

        :type t: str

        :rtype: str

        """

        dic,dif=collections.Counter(s),collections.Counter(t)

        for i in dif:

            if i not in dic or dic[i]!=dif[i]:

                return i
        return

返回不一样的元素
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: