diff --git a/LeetCode/0074_Search_a_2D_Matrix.py b/LeetCode/0074_Search_a_2D_Matrix.py new file mode 100644 index 0000000..9bd7569 --- /dev/null +++ b/LeetCode/0074_Search_a_2D_Matrix.py @@ -0,0 +1,36 @@ +class Solution: + def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: + + def binary_search(arr, target): + low = 0 + high = len(arr)-1 + while low<=high: + mid = low + (high-low)//2 + if arr[mid] == target: + return True + elif arr[mid]