diff --git a/articles/binary-search.md b/articles/binary-search.md index 5e88782ce..bfc872a8a 100644 --- a/articles/binary-search.md +++ b/articles/binary-search.md @@ -312,7 +312,7 @@ class Solution { ```python class Solution: def search(self, nums: List[int], target: int) -> int: - l, r = 0, len(nums) + l, r = 0, len(nums) -1 while l < r: m = l + ((r - l) // 2) @@ -455,7 +455,7 @@ class Solution { ```python class Solution: def search(self, nums: List[int], target: int) -> int: - l, r = 0, len(nums) + l, r = 0, len(nums) -1 while l < r: m = l + ((r - l) // 2) @@ -669,4 +669,4 @@ class Solution { ### Time & Space Complexity * Time complexity: $O(\log n)$ -* Space complexity: $O(1)$ \ No newline at end of file +* Space complexity: $O(1)$