# pylint: disable-all
import unittest
from typing import List
"""
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.

 

Example 1:

Input: s = "abcd", t = "abcde"
Output: "e"
Explanation: 'e' is the letter that was added.
Example 2:

Input: s = "", t = "y"
Output: "y"
 

Constraints:

0 <= s.length <= 1000
t.length == s.length + 1
s and t consist of lowercase English letters.
"""


class Solution:
    def findTheDifference(self, s: str, t: str) -> str:
        s, t = list(s), list(t)
        for c in s:
            t.remove(c)
        return t[0]

    def findTheDifference_better(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        ans = 0
        for c in s + t:
            ans ^= ord(c)
        return chr(ans) 

class MyTest(unittest.TestCase):
    def test_example1(self):
        solution = Solution()
        self.assertEqual("e", solution.findTheDifference_better(s="abcd", t="abcde"))

    def test_example2(self):
        solution = Solution()
        self.assertEqual("y", solution.findTheDifference_better(s="", t="y"))


if __name__ == '__main__':
    unittest.main()
