public int searchMatrix_lint(int[][] matrix, int target) {
        if (matrix == null || matrix.length == 0)
            return 0;
        if (matrix[0] == null || matrix[0].length == 0)
            return 0;
        int row = 0, column = matrix[0].length - 1;
        int count = 0;
        while (row < matrix.length && column >= 0) {
            int val = matrix[row][column];
            if (val == target) {
                ++count;
                ++row;
                --column;
            } else if (val < target) {
                ++row;
            } else {
                // val > target
                if (binarySearch(matrix[row], target)) {
                    ++count;
                }
                ++row;
                --column;
            }
        }
        return count;
    }