The problem actually needs more clarification on number of possible peaks. From my point of view, if an input array has a huge number of peaks (especially many are the same), it would be trivial to come up with an accurate binary search solution.

in that case, you may return 1, 3, or, 5. anyone of them is ok. the judge system use special rules for this problem. so you do not need to worry about it.

Thanks. I have updated the problem statement that clarifies that the input array may contain multiple peaks. In that case return the index to any one of the peaks is fine.