"""
348
intersection of two arrays
easy

Given two integer arrays nums1 and nums2, return an array of their
intersection. Each element in the result must be unique and you
may return the result in any order.


"""


from typing import List

class Solution:
    def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
        inter = {}

        for i in nums1:
            if i not in inter and i in nums2:
                inter[i] = None

        res = []

        for key in inter:
            res.append(key)

        return res



