Facebook Interview Report
- 1of 1 vote
AnswersYou have a array with integers:
[ 1, -2, 0, 6, 2, -4, 6, 6 ]
You need to write a function which will evenly return indexes of a max value in the array.
- vu-doo-cok May 22, 2017 in UK
In the example below max value is 6, and its positions are 3, 6 and 7. So each run function should return random index from the set.
Try to implement with O(n) for computation and memory.
Try to reduce memory complexity to O(1).| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.