mediumDSA

Top K Frequent Elements

Return the k most frequent elements in an array.
Ensure function signatures match starter code to run test cases.
index.js
Loading...

Test Case #1

Input: [1,1,1,2,2,3],2

Expected: [1,2]