easy solution
Intuition\nTo find the integers present in each array of a 2D integer array nums, we need to identify elements that appear in all the subarrays.\n\n# Approach\n
# Intuition\nTo find the integers present in each array of a 2D integer array `nums`, we need to identify elements that appear in all the subarrays.\n\n# Approach\n1. Create a frequency array `freq` to count the occurrences of each integer across all subarrays.\n2. Iterate through each subarray in `nums` and update the frequency count for each element.\n3. After counting, iterate through the frequency array and collect integers that have a frequency equal to the number of subarrays (i.e., they appear in all subarrays).\n4. Return the list of these integers sorted in ascending order.\n\n# Complexity\n- Time complexity: $$O(n \\times m)$$\n  - Where $$n$$ is the number of subarrays and $$m$$ is the average number of elements in each subarray. We iterate through each element of each subarray.\n- Space complexity: $$O(1)$$\n  - We use a fixed-size frequency array with size 1001 to store counts of elements.\n\n# Code\n```cpp\nclass Solution {\npublic:\n    vector<int> intersection(vector<vector<int>>& nums) {\n        vector<int> freq(1001, 0);\n        for (int i = 0; i < nums.size(); i++) {\n            for (int j = 0; j < nums[i].size(); j++) {\n                freq[nums[i][j]]++;\n            }\n        }\n        vector<int> ans;\n        for (int i = 0; i <= 1000; i++) {\n            if (freq[i] == nums.size()) ans.push_back(i);\n        }\n        return ans;\n    }\n};\n```
['Array', 'Hash Table', 'Counting', 'C++']