mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11: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]:
|
if not matrix or not matrix[0]:
|
||||||
raise ValueError("matrix must not be empty")
|
raise ValueError("matrix must not be empty")
|
||||||
|
|
||||||
rows = len(matrix)
|
rows = len(matrix)
|
||||||
cols = len(matrix[0])
|
cols = len(matrix[0])
|
||||||
|
|
||||||
for row in matrix:
|
for row in matrix:
|
||||||
if len(row) != cols:
|
if len(row) != cols:
|
||||||
raise ValueError("matrix must be rectangular")
|
raise ValueError("matrix must be rectangular")
|
||||||
|
|
||||||
left, right = 0, rows * cols - 1
|
left, right = 0, rows * cols - 1
|
||||||
|
|
||||||
while left <= right:
|
while left <= right:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user