Arm Interview Question

The third question was about to write a function in Python that finds the rarest number in a list with nlogn complexity.

Interview Answers

Anonymous

Mar 23, 2020

Use hashmap to store the frequency of each element and return the one with lowest freq.

Anonymous

Oct 27, 2020

But the hashmap would require O(n) time and space, right? Sorting requires O(log(n) *n ) time and O(1) space. So I think it would be great to show those two options.