3 ms·
That said: you are right that the inner -1 should never happen. But why are we binary searching in the first place? Maybe we should have stored the values as a
by 1-more 6y ago
That said: you are right that the inner -1 should never happen. But why are we binary searching in the first place? Maybe we should have stored the values as a set and then called Set.member; it's extremely rare to actually even use Arrays in FP languages as far as I know. I usually am only working with Maps, Sets, and Lists.