You are tasked with building a service to find number of times we have bid with same value in a list of prev bids. Your service will be invoked several millions of times in a day and solution needs to be as fast as possible. Let us define api interface as "int countInHistory(int currentBid, int[] previousBids)".
E.g
prev bids - [4, 4, 4, 6, 6, 7, 9, 14, 14, 14, 14, 17]
cur bid - 14
ans - 4
basically, is asked me finding how many counts in the array by less than log(n)