Given two 0-indexed integer arrays
nums1
andnums2
, return a listanswer
of size2
where:
answer[0]
is a list of all distinct integers innums1
which are not present innums2
.answer[1]
is a list of all distinct integers innums2
which are not present innums1
.
Note that the integers in the lists may be returned in any order.
Constraints:
1 <= nums1.length, nums2.length <= 1000
-1000 <= nums1[i], nums2[i] <= 1000
給予兩個初始值為 0 的陣列
nums1
和nums2
,回傳一個大小為2
的 list:
answer[0]
是一個 list,包含全部都不同的整數且指出現在nums1
沒出現在nums2
answer[1]
是一個 list,包含全部都不同的整數且指出現在nums2
沒出現在nums1
在 list 中的整數可以以任意順序回傳。
限制:
1 <= nums1.length, nums2.length <= 1000
-1000 <= nums1[i], nums2[i] <= 1000
nums1
與 nums2
出現過哪些數字
LeetCode
C++