Solution for find the difference doesn't work


  • 0

    '''class Solution(object):
    def findTheDifference(self, s, t):
    """
    :type s: str
    :type t: str
    :rtype: str
    """
    rtype = ''.join(str(e) for e in (set(s) - set(t)))
    return rtype

    test = Solution()
    test.findTheDifference("abcde", "abcd")
    '''

    This solution seems to work fine on my native compiler. Am i missing something here ?


Log in to reply
 

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