2248. Intersection of Multiple Arrays

2022. 4. 29. 19:23Algorithm/Leetcode, Lintcode, HackerRank, etc.

    목차
반응형

 

class Solution:
    def intersection(self, nums: List[List[int]]) -> List[int]:
        intr = set(nums[0])
        for num in nums[1:]:
            intr = intr & set(num)

        return sorted(intr)
반응형