diff --git a/matrix/binary_search_matrix.py b/matrix/binary_search_matrix.py index 6f203b7a3484..c9668a9438c1 100644 --- a/matrix/binary_search_matrix.py +++ b/matrix/binary_search_matrix.py @@ -43,7 +43,7 @@ def mat_bin_search(value: int, matrix: list) -> list: index = 0 if matrix[index][0] == value: return [index, 0] - while index < len(matrix) and matrix[index][0] < value: + while index < len(matrix) and matrix[index][0] <= value: r = binary_search(matrix[index], 0, len(matrix[index]) - 1, value) if r != -1: return [index, r]