Create Sorted Array through Instructions
Each inserted value costs the smaller of the count below it and the count above it; counting these is a sweep over the values seen so far.
Each inserted value costs the smaller of the count below it and the count above it; counting these is a sweep over the values seen so far.