исправил маленькую ошибку

This commit is contained in:
Игорь
2026-04-01 11:45:09 +03:00
parent 04f96b1df9
commit 3d21b7d91d

View File

@@ -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