Leetcode 2d Binary Search Pseudocode