Search Target: 15s
Right boundary search finds the insertion point after equals. Paired with bisect_left for range counting.
lo, hi = 0, len(a)
while lo < hi:
mid = lo + (hi - lo) // 2
if a[mid] <= target: lo = mid + 1
else: hi = mid
return lo
Type it from memory. Go.