Leetcode Binary Search Template Sort