Implement binary search for boundary index | Snapchat