Implement binary search lower/upper bounds | Amazon Interview Question