Meta Interview Question

Find the indices of max. value in a large array and return them.

Interview Answers

Anonymous

Nov 14, 2016

brute force. He tried to help. But I couldn't go beyond brute force. He suggested i should focus on optimizing space complexity as array can be large (meaning result list can also be large)

Anonymous

Nov 26, 2016

use a bit set to optimize space complexity

Anonymous

Jan 6, 2017

if the input array can be updated, there can be an O(1) space solution. Essentially, for all the elements sharing the same max value, we update the element to record the index of the previous one of the same value.