исправил маленькую ошибку
This commit is contained in:
@@ -34,9 +34,9 @@ def search_binary_diagonal(matrix, K):
|
|||||||
if pos < M and row[pos] == K:
|
if pos < M and row[pos] == K:
|
||||||
return True, steps
|
return True, steps
|
||||||
|
|
||||||
if diag_indx >= 0 and diag_idx < M:
|
if diag_indx >= 0 and diag_indx < M:
|
||||||
steps += 1
|
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)
|
pos = b.bisect_left(col_values, K)
|
||||||
if pos < N and col_values[pos] == K:
|
if pos < N and col_values[pos] == K:
|
||||||
return True, steps
|
return True, steps
|
||||||
|
|||||||
Reference in New Issue
Block a user