347. Top K Frequent Elements

Bucket sort

time: O(n)

space: O(n)

Min Heap

time: O(nlogn)

space: O(n)

Last updated