Beginners Friendly solution
\n# Code\n\nclass Solution {\n    public List<Integer> intersection(int[][] nums) {\n        // add 1st row to set\n        HashSet<Integer> common= new HashSet
\n# Code\n```\nclass Solution {\n    public List<Integer> intersection(int[][] nums) {\n        // add 1st row to set\n        HashSet<Integer> common= new HashSet<>();\n\n        for(int i=0;i<nums[0].length;i++){\n            common.add(nums[0][i]);\n        }\n        //now add other rows and retain only those in common if it present in current set;\n\n        for(int i=1;i<nums.length;i++){\n            HashSet<Integer> current= new HashSet<>();\n            for(int j=0;j<nums[i].length;j++){\n                if(common.contains(nums[i][j]))\n                        current.add(nums[i][j]);\n            }\n            common.retainAll(current);\n        }\n\n        List<Integer> ls= new ArrayList<>(common);\n        Collections.sort(ls);\n\n        return ls;\n\n    }\n}\n```
['Java']