347. Top K Frequent Elements

来源:互联网 发布:windows python安装 编辑:程序博客网 时间:2024/06/07 18:29
class Solution(object):
    def topKFrequent(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: List[int]
        """
        dic=zip(*collections.Counter(nums).most_common(k))[0]
        return dic
            
原创粉丝点击