diff --git a/sorts/binarysearch_on_sorted_2d_array.py b/sorts/binarysearch_on_sorted_2d_array.py index 3dca954ac..b5c4e95a1 100644 --- a/sorts/binarysearch_on_sorted_2d_array.py +++ b/sorts/binarysearch_on_sorted_2d_array.py @@ -33,14 +33,14 @@ def binary_search_2d(matrix: list[list[int]], target: int) -> tuple[int, int]: """ if not matrix or not matrix[0]: raise ValueError("matrix must not be empty") - + rows = len(matrix) cols = len(matrix[0]) - + for row in matrix: if len(row) != cols: raise ValueError("matrix must be rectangular") - + left, right = 0, rows * cols - 1 while left <= right: