diff --git a/task1(2).py b/task1(2).py index 24180a7..494f902 100644 --- a/task1(2).py +++ b/task1(2).py @@ -34,9 +34,9 @@ def search_binary_diagonal(matrix, K): if pos < M and row[pos] == K: return True, steps - if diag_indx >= 0 and diag_idx < M: + if diag_indx >= 0 and diag_indx < M: steps += 1 - col_values = [matrix[i][diag_idx] for i in range(N)] + col_values = [matrix[i][diag_indx] for i in range(N)] pos = b.bisect_left(col_values, K) if pos < N and col_values[pos] == K: return True, steps