Frage im Vorstellungsgespräch bei Meta

Given a sorted array that may have repeated elements, count each different element.

Antwort im Vorstellungsgespräch

Anonym

27. Okt. 2017

At first, I used a dictionary, then I wrote a solution using binary search to find the upper bound of each different element.