Problem 2966 · Medium

Divide Array Into Arrays With Max Difference

After sorting, consecutive triples have the smallest possible spread, so checking them one by one decides feasibility.

Open the interactive visualisation