Skip to content

Commit ed2bb6f

Browse files
authored
Update Search a 2D Matrix - Leetcode 74.py
1 parent 19b1fb0 commit ed2bb6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Search a 2D Matrix - Leetcode 74/Search a 2D Matrix - Leetcode 74.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
2020

2121
while l <= r:
2222
mid = (l + r) // 2
23-
i = mid // n
24-
j = mid % n
25-
mid_num = matrix[i][j]
23+
mid_i = mid // n
24+
mid_j = mid % n
25+
mid_num = matrix[mid_i][mid_j]
2626

2727
if target == mid_num:
2828
return True

0 commit comments

Comments
 (0)