LeetCode Experience · Mar 2020 · USA

Facebook Interview question | Solutions Engineer | Phone Screen

2 upvotes 1,298 views 6 replies

Interview Experience

Given an unsorted array return the k most frequest elements in O(N) time. For example, [1,2,1,1,2,3,4,2,1,1,1,3] and k=2 return [1,2] I gave a O(N * logK) solution using heap and a...

Full Details

🔒

Unlock full leaked content

Full insider details, leaked discussions, and candidate experiences.

Get Premium →

Topics

Arrays Hash Table Heap