Problem 1122 · Easy

Relative Sort Array

Sort an array so that values follow a given relative order, with unlisted values placed afterwards in ascending order. Counts for each value drive the construction of the result.

Open the interactive visualisation