Binary Search Leetcode Solution Python