alternative solution to searchMatrix using binary search