LeetCode/NeetCodeRoadmap/Arrays_and_Hashing/347_Top_K_Frequent_Elements.py
2023-08-08 23:28:37 -07:00

11 lines
225 B
Python

def topKFrequent(nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
frequency = {}
for x in nums:
print(topKFrequent([1,1,1,2,2,3], 2))