🌟 Beats 100.00% || Python One Line 💯🔥
Intuition\nThe intuition for this problem is to first collect all the elements from the input lists into a single list, then count the frequency of each element
# Intuition\nThe intuition for this problem is to first collect all the elements from the input lists into a single list, then count the frequency of each element. Elements that appear in all the input lists (i.e. have a frequency equal to the number of input lists) are the final result.\n\n# Approach\n1. Initialize an empty list `my_list` to store all the elements from the input lists.\n2. Iterate through each input list and extend `my_list` with the elements from that list.\n3. Create a `Counter` object to count the frequency of each element in `my_list`.\n4. Iterate through the `Counter` object and add any elements with a frequency equal to the number of input lists to the result list `res`.\n5. Return the sorted result list `res`.\n\n# Complexity\n- Time complexity: $$O(n)$$, where n is the total number of elements in all the input lists. We iterate through the input lists once to build `my_list`, then iterate through the `Counter` object once to build the result.\n- Space complexity: $$O(n)$$, where n is the total number of elements in all the input lists. We store all the elements in `my_list` and the frequency counts in the `Counter` object.\n\n# Code\n```python3 []\nclass Solution:\n    def intersection(self, nums: List[List[int]]) -> List[int]:\n        my_list=[]\n        for i in nums:\n            my_list.extend(i)\n        c=Counter(my_list)\n        res=[]\n        for k, v in c.items():\n            if v>=len(nums):\n                res.append(k)\n        return sorted(res)\n```\n\n# Code in one line \n```python3 []\nclass Solution:\n    def intersection(self, nums: List[List[int]]) -> List[int]:\n        return return sorted([k for k, v in Counter([x for sublist in nums for x in sublist]).items() if v >= len(nums)])\n1``
['Python3']