Code
The highlighted line runs next. The pill shows the live values in the running call.
Cost
Work done so far, and how the four solutions compare
Array
Arrows mark the positions being compared
The highlighted line runs next. The pill shows the live values in the running call.
Work done so far, and how the four solutions compare
Arrows mark the positions being compared
Keyboard: ← → step, Space play or pause. Up to 12 numbers; switching solution keeps the input. Try "dup at start" in each mode: the brute force and hash set stop at once, sorting still pays for the sort, and the set-length version still reads everything.