首页 > 代码库 > 【leetcode?python】Find the Difference

【leetcode?python】Find the Difference

#-*- coding: UTF-8 -*-
class Solution(object):
    def findTheDifference(self, s, t):
        
        s=sorted(list(s))
        t=sorted(list(t))
   
        for st in s:
      
            p=t.index(st)
            del t[p]

        
        return ‘‘.join(t)
          
                
            
       
sol=Solution()
print sol.findTheDifference(‘abddcde‘, ‘eabadbdccdde‘)

【leetcode?python】Find the Difference