Imagine you're organizing a group project where each team member has their own list of preferred meeting days. You need to find the days that everyone is available to meet.
Given a 2D integer array nums where each nums[i] represents a non-empty array of distinct positive integers, your task is to find all integers that appear in every single array. The result should be returned as a list sorted in ascending order.
Think of it as finding the common elements across multiple sets - only the numbers that show up in all arrays make it to the final answer.
Example: If you have [[3,1,2,4,5],[1,2,3,4],[3,4,5,6]], only [3,4] appear in all three arrays.
Input & Output
Visualization
Time & Space Complexity
Visit each element once across all arrays, with set intersection operations being efficient
Set size never exceeds the smallest array size due to progressive intersection
Constraints
- 1 ≤ nums.length ≤ 1000
- 1 ≤ sum(nums[i].length) ≤ 1000
- 1 ≤ nums[i][j] ≤ 1000
- All values in nums[i] are distinct