Skip to content

Commit

Permalink
Time: 37 ms (64.93%), Space: 16.5 MB (85.02%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
hugehoo committed May 6, 2024
1 parent 08fce00 commit 30dc313
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 0389-find-the-difference/0389-find-the-difference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Solution:
def findTheDifference(self, s: str, t: str) -> str:
sl = sorted(list(s))
tl = sorted(list(t))
for i in range(len(sl)):
if sl[i] != tl[i]:
return tl[i]
return tl[-1]

0 comments on commit 30dc313

Please sign in to comment.