Problem 910 · Medium

Smallest Range II

Sort, then try every split where the prefix gets +k and the suffix gets -k.

Open the interactive visualisation