Problem 4031 · Medium

Find All Numbers Disappeared in an Array II

Sort the values that are present, then walk the gaps inside [lower, upper] and merge consecutive missing numbers into ranges.

Open the interactive visualisation