389. Find the Difference
来源:互联网 发布:php7不支持mysql 编辑:程序博客网 时间:2024/06/04 17:57
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
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
返回不一样的元素
阅读全文
0 0
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference*
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- HDU4886 TIANKENG’s restaurant(Ⅱ)(哈希)
- Java中ArrayList详解与练习
- Pentaho Kettle解决方案:使用PDI构建开源ETL解决方案pdf
- 有趣的一道题
- JaveScript之数组实训案例
- 389. Find the Difference
- MFC的学习笔记(一)
- AndroidStudio 中如何查看获取MD5和SHA1值(应用签名)
- pthread_cond_wait()用法分析
- Oracle唯一主键ID的生成
- android Fragment实现Tab功能(fragment相互切换时,可保存之前状态)
- 利用cron监视后台进程状态(一)
- Subversion(SVN)学习笔记
- MFC学习笔记(二)