C# with detailed explanation
Approach\n1. Using a dictionary, we are going to count the number of occurrences of each integer in ALL ARRAYS.\n2. After that, it checks WHICH NUMBERS have cou
# Approach\n1. Using a dictionary, we are going to count the number of occurrences of each integer in **ALL ARRAYS**.\n2. After that, it checks WHICH NUMBERS have counts **EQUAL** to the **LENGTH** of the input array, meaning they are present in all subarrays.\n\n# C# Syntax Highlights\n- **IList<int>** instead of a concrete implementation like List<int> in C# allows for more flexibility. A list is a more specific type that implement the interface IList. Problably not make a difference here.\n\n**LINQ FILTERS: Where, Select, OrderBy, ToArray**\n- The Where method is used to filter a collection based on a condition specified by a lambda expression. In this code, it **returns a new collection of key-value pairs where the value of each key is equal to the length of the nums array**.\n- The Select method takes the filtered collection of key-value pairs and **creates a new collection that contains only the keys**.\n- The OrderBy method **sorts the collection** in ascending order by the key.\n- Finally, the ToArray method converts the collection to an array.\n\n# Complexity\n- Time complexity:\n\n    The time complexity of this code is O(nmlog(m)). \n    n = number of subarrays \n    m = maximum length each (so nm). \n    \n    The sorting adds the logm to the final complexity.\n    \n    Using a dictionary is generally faster than using a list for counting occurrences of elements, because dictionary lookup and insertion have an average time complexity of O(1), while list lookup and insertion have an average time complexity of O(n).\n\n\n- Space complexity:\n    The space complexity of this code is also O(n*m), because the code uses a dictionary to store the counts of each integer.\n\n# Code\n```\npublic class Solution {\n    public IList<int> Intersection(int[][] nums) {\n        Dictionary<int, int> counts = new Dictionary<int, int>();\n\n        foreach (int[] arr in nums) {\n            foreach (int n in arr) {\n                if (!counts.ContainsKey(n)) {\n                    counts.Add(n, 1);\n                }\n                else {\n                    counts[n]++;\n                }\n            }\n        }\n\n        return counts.Where(x => x.Value == nums.Length)\n                     .Select(x => x.Key)\n                     .OrderBy(x => x)\n                     .ToArray();\n    }\n}\n```
['C#']