본문 바로가기
python-algorithm

leetcode 389. Find the Difference

by 무적김두칠 2022. 3. 24.

1
2
3
4
5
6
7
8
9
10
11
12
13
class Solution:
    def findTheDifference(self, s: str, t: str-> str:
        ans=''
        sList=[]
        tList=[]
        for i in s: sList.append(i)
        for i in t: tList.append(i)
 
        for i in sList:
            tList.pop(tList.index(i))
        for i in tList:
            ans+=i
        return ans
cs
반응형

댓글