@@ -0,0 +1,740 @@
+# Given two strings s and t which consist of only lowercase letters.%0A%0A# String t is generated by random shuffling string s and then add one more letter at a random position.%0A%0A# Find the letter that was added in t.%0A%0A# Example:%0A# Input:%0A# s = %22abcd%22%0A# t = %22abcde%22%0A%0A# Output:%0A# e%0A%0A# Explanation:%0A# 'e' is the letter that was added.%0A%0A%0Adef findTheDifference(s, t):%0A  %22%22%22%0A  :type s: str%0A  :type t: str%0A  :rtype: str%0A  %22%22%22%0A  dict = %7B%7D%0A  for letter in t:%0A    dict%5Bletter%5D = dict.get(letter, 0) + 1%0A%0A  for letter in s:%0A    if letter in dict.keys():%0A      if dict%5Bletter%5D == 1:%0A        del dict%5Bletter%5D%0A      else:%0A        dict%5Bletter%5D -= 1%0A%0A  for letter in dict.keys():%0A    return letter%0A%0As = %22abcdefg%22%0At = %22bfcazgde%22%0A%0Aprint(findTheDifference(s, t))

Solve Find the Difference