Given a 2D integer array <code>nums</code> where <code>nums[i]</code> is a non-empty array of <strong>distinct</strong> positive integers, return <em>the list of integers that are present in <strong>each array</strong> of</em> <code>nums</code><em> sorted in <strong>ascending order</strong></em>.
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> nums = [[<u><strong>3</strong></u>,1,2,<u><strong>4</strong></u>,5],[1,2,<u><strong>3</strong></u>,<u><strong>4</strong></u>],[<u><strong>3</strong></u>,<u><strong>4</strong></u>,5,6]]
<strong>Output:</strong> [3,4]
<strong>Explanation:</strong> 
The only integers present in each of nums[0] = [<u><strong>3</strong></u>,1,2,<u><strong>4</strong></u>,5], nums[1] = [1,2,<u><strong>3</strong></u>,<u><strong>4</strong></u>], and nums[2] = [<u><strong>3</strong></u>,<u><strong>4</strong></u>,5,6] are 3 and 4, so we return [3,4].</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> nums = [[1,2,3],[4,5,6]]
<strong>Output:</strong> []
<strong>Explanation:</strong> 
There does not exist any integer present both in nums[0] and nums[1], so we return an empty list [].
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= nums.length &lt;= 1000</code></li>
	<li><code>1 &lt;= sum(nums[i].length) &lt;= 1000</code></li>
	<li><code>1 &lt;= nums[i][j] &lt;= 1000</code></li>
	<li>All the values of <code>nums[i]</code> are <strong>unique</strong>.</li>
</ul>

class Solution:
    def intersection(self, nums: List[List[int]]) -> List[int]:
        # [[3,1,2,4,5],[1,2,3,4],[3,4,5,6]]
        # add elements of 1st list in a set
        # check if element of 2nd list exist in the set track them
        # now check element in 3rd list if exist in 2nd set track them
        # at end

        # matching_set = set(nums[0])
        # for arr in nums[1:]:
        #     new_set = set()
        #     for i in range(len(arr)):
        #         if arr[i] in matching_set:
        #             new_set.add(arr[i])

        #     matching_set = new_set
        
        # return sorted(list(matching_set))

            if not nums:
                return []

            # Initialize the intersection set with the elements of the first list
            intersection = set(nums[0])

            # Iterate through the remaining lists and update the intersection
            for num_list in nums[1:]:
                intersection = intersection.intersection(set(num_list))

            return sorted(list(intersection))
74