Problem 942 · Easy

DI String Match

Build a permutation of the numbers zero through n that agrees with a string of increase and decrease instructions. The visual uses a low and high marker that close in on the number line.

Open the interactive visualisation