LeetCode Algorithm 389. 找不同
生活随笔
收集整理的這篇文章主要介紹了
LeetCode Algorithm 389. 找不同
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
389. 找不同
Ideas
emmm,排個序,然后挨個比較?
Code
Python
class Solution:def findTheDifference(self, s: str, t: str) -> str:s = sorted(s)t = sorted(t)for i, v in enumerate(s):if t[i] != v:return t[i]return t[-1]總結
以上是生活随笔為你收集整理的LeetCode Algorithm 389. 找不同的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2020年第十一届蓝桥杯 - 省赛 -
- 下一篇: POJ 3981.字符串替换