Back to QuestionsPractice with This Question
Top K Frequent Elements
99.4K views•Asked at Uber•
Medium
Question Explain
Given a non-empty array of integers, return the $k$ most frequent elements. The time complexity must be better than $O(n \log n)$. Use a Min-Heap or Bucket Sort.
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.