1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
pythoclass Solution:
def findDifference(self, nums1: List[int], nums2: List[int]) -> List[List[int]]:
ans1=[]
ans2=[]
ans_list=[]
for i in nums1 :
if i not in nums2:
ans1.append(i)
for i in nums2 :
if i not in nums1:
ans2.append(i)
ans_list.append(list(set(ans1)))
ans_list.append(list(set(ans2)))
return ans_list
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
codeforces 791A - Bear and Big Brother (0) | 2022.07.12 |
---|---|
leetcode 2022. Convert 1D Array Into 2D Array (0) | 2022.07.11 |
leetcode 2303. Calculate Amount Paid in Taxes (0) | 2022.07.07 |
leetcode 1945. Sum of Digits of String After Convert (0) | 2022.07.07 |
백준 25305 커트라인 (0) | 2022.07.07 |
댓글