Simple Python Solution

  • 2
    class Solution(object):
        def findTheDifference(self, s, t):
            :type s: str
            :type t: str
            :rtype: str
            for ch in t:
                if (s+t).count(ch)%2:
                    return ch;

  • 0

    The method is very cool.

  • 0

    Very interesting idea, however this would repeatedly look at the same letters .. i.e. the e below.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.