Code
The highlighted line runs next. The pill shows the live values in the running call.
Cost
Work done so far, and how the five solutions compare
Sorted array
Faded cells are ruled out; "end" is the position one past the last element
The highlighted line runs next. The pill shows the live values in the running call.
Work done so far, and how the five solutions compare
Faded cells are ruled out; "end" is the position one past the last element
Keyboard: ← → step, Space play or pause. Up to 16 distinct numbers in ascending order, values −99 to 99. Compare the step counts: the closed-range versions can stop as soon as they hit the target, while the bound versions always shrink the range to nothing.