primeiro commit
This commit is contained in:
14
389-find_the_difference/389.py
Normal file
14
389-find_the_difference/389.py
Normal file
@ -0,0 +1,14 @@
|
||||
# 389. Find the Difference
|
||||
# https://leetcode.com/problems/find-the-difference
|
||||
#
|
||||
# You are given two strings s and t.
|
||||
#
|
||||
# String t is generated by random shuffling string s and then add one more letter at a random position.
|
||||
#
|
||||
# Return the letter that was added to t.
|
||||
|
||||
def findTheDifference(s: str, t: str) -> str:
|
||||
for i in range(len(t)):
|
||||
if s.count(t[i]) != t.count(t[i]):
|
||||
return t[i]
|
||||
return ""
|
||||
Reference in New Issue
Block a user