Variation of One-sided Binary Search.
Need to be careful with the update condition; we have to update res = m
if m == alen - 1
, since if we try to access any index larger than alen - 1
we’re gonna get an error (outside of array).
Variation of One-sided Binary Search.
Need to be careful with the update condition; we have to update res = m
if m == alen - 1
, since if we try to access any index larger than alen - 1
we’re gonna get an error (outside of array).