'''

Given two strings s and t which consist of only lowercase letters.

String t is generated by random shuffling string s and then add one more letter at a random position.

Find the letter that was added in t.

Example:

Input:
s = "abcd"
t = "abcde"

Output:
e

Explanation:
'e' is the letter that was added.

'''
import unittest


class Solution(object):
    def findTheDifference(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: str
        """
        standand_s = [chr(i) for i in range(ord('a'), ord('{'))]
        s_list = [s.count(word) for word in standand_s]
        t_list = [t.count(word) for word in standand_s]
        for index, value in enumerate(zip(s_list, t_list)):
            if value[0] != value[1]:
                return standand_s[index]

class TestSolution(unittest.TestCase):

    def test_findTheDifference(self):
        examples = (
            (('abcd', 'abcde'), 'e'),
        )
        for first, second in examples:
            self.assert_function(first, second)

    def assert_function(self, first, second):
        self.assertEqual(Solution().findTheDifference(*first), second, msg="first: {}; second: {}".format(first, second))


unittest.main()