Skip to content

Commit f4e7676

Browse files
committed
Fix matrix binary search at row starts
1 parent 215c1f0 commit f4e7676

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎matrix/binary_search_matrix.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def mat_bin_search(value: int, matrix: list) -> list:
4343
index = 0
4444
if matrix[index][0] == value:
4545
return [index, 0]
46-
while index < len(matrix) and matrix[index][0] < value:
46+
while index < len(matrix) and matrix[index][0] <= value:
4747
r = binary_search(matrix[index], 0, len(matrix[index]) - 1, value)
4848
if r != -1:
4949
return [index, r]

0 commit comments

Comments
 (0)