2025-08-18 11:48:14 +0000 UTC

Intersection of Multiple Arrays

Code

class Solution:
    def intersection(self, nums: List[List[int]]) -> List[int]:
        enc = set(nums[0])
        for arr in nums[1:]:
            enc.intersection_update(arr)
        return sorted(enc)