Checking distinct positive integers with map in Kotlin
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    fun intersection(nums: Array<IntArray>): List<Int> {\n        val bucket = nums.flatMap { it.toList() }.groupingBy { it }.eachCount()\n        val answer = mutableListOf<Int>()\n        \n        for(key in bucket.keys) {\n            if(bucket[key] == nums.size) {\n                answer.add(key)\n            }\n        }\n\n        return answer.sorted()\n    }\n}\n```
['Array', 'Kotlin']