mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 15:01:08 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
c0b6798952
commit
ac0008a523
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user