389. 找不同
Ideasemmm,排个序,然后挨个比较?
Code Pythonclass 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]
389. 找不同
Ideasemmm,排个序,然后挨个比较?
Code Pythonclass 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]
微信扫码登录