JAVA solution | Count sort | No hashing | Easy
Please Upvote !!! (\u25E0\u203F\u25E0)\n\nclass Solution {\n    public List<Integer> intersection(int[][] nums) {\n        int[] freq = new int[1001];\n\n      
### ***Please Upvote !!!*** **(\u25E0\u203F\u25E0)**\n```\nclass Solution {\n    public List<Integer> intersection(int[][] nums) {\n        int[] freq = new int[1001];\n\n        for (int[] row : nums) {\n            for (int n : row) {\n                freq[n]++;\n            }\n        }\n\n        List<Integer> ans = new ArrayList<>();\n\t\t\n        for (int i = 1; i < freq.length; i++) {\n            if (freq[i] == nums.length) {\n                ans.add(i);\n            }\n        }\n\n        return ans;\n    }\n}\n\n// TC: O(m * n), SC: O(1) - ignoring the output array\n```
['Java']