primeiro commit

This commit is contained in:
2025-02-12 12:33:39 +00:00
commit 0204a191c7
7 changed files with 96 additions and 0 deletions

View 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 ""