Upper Bound Using Binary Search In Leetcode