MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / find_bi

Method find_bi

Array/SlidingWindowMaximum.py:47–60  ·  view source on GitHub ↗
(self, nums, target)

Source from the content-addressed store, hash-verified

45
46class Solution(object):
47 def find_bi(self, nums, target):
48 lo = 0
49 hi = len(nums)
50
51 while lo < hi:
52 mid = (lo + hi) // 2
53
54 if nums[mid] == target:
55 return mid
56
57 if nums[mid] < target:
58 lo = mid + 1
59 else:
60 hi = mid
61
62 def maxSlidingWindow(self, nums, k):
63 """

Callers 1

maxSlidingWindowMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected