2248. Intersection of Multiple Arrays
On This Page
class Solution:
def intersection(self, nums: List[List[int]]) -> List[int]:
cnt = Counter()
res = []
for arr in nums:
for x in arr:
cnt[x] += 1
if cnt[x] == len(nums):
res.append(x)
res.sort()
return res