Back to QuestionsPractice with This Question
Top K Frequent Elements (Heap/Bucket Sort)
31.1K views•Asked at Netflix•
Medium
Question Explain
Given a non-empty list of words/numbers, return the $k$ most frequent elements. 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.