why I use set() in Python occurrence an unexpected result


  • 0
    S

    here is my code

    class Solution(object):
        def findTheDifference(self, s, t):
            """
            :type s: str
            :type t: str
            :rtype: str
            """
            return list(set(list(t))-set(list(s)))
    
    
    findTheDifference("abcd","abcde") # return  '[u'e']'
    

    I don't know what happend


  • 0
    S
    This post is deleted!

Log in to reply
 

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