class Solution(object):
    def topKFrequent(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: List[int]
        """
        li = []
        from collections import Counter
        for item in Counter(nums).most_common(k):
            li.append(item[0])
        return li;

be08ec980037d6b3ec993517a3a68e158978be77
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def topKFrequent(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: List[int]
        """
        li = []
        from collections import Counter
        for item in Counter(nums).most_common(k):
            li.append(item[0])
        return li

class Solution(object):
    def topKFrequent(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: List[int]
        """
        li = []
        from collections import Counter
        for item in Counter(nums).most_common(k):
            li.append(item[0])
        return li;
