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
返回不一样的元素
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
返回不一样的元素
相关文章推荐
- 389. Find the Difference
- leetcode算法——389. Find the Difference(基于JAVA)
- [LeetCode] 389.Find the Difference
- LeetCode 简单操作 | 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- LeetCode 389. Find the Difference
- 389. Find the Difference
- LeetCode:Find the Difference_389
- 【LeetCode】 389. Find the Difference
- 389. Find the Difference
- 【LeetCode】389 Find the Difference(java)
- [LeetCode-389]Find the Difference
- Tutorial: 389. Find the Difference
- LeetCode 389. Find the Difference
- HashTable-389-Find the Difference
- LeetCode@HashMap_389_Find_the_Difference
- 389. Find the Difference
- 389. Find the Difference
- Leetcode 389 Find the Difference