Problem 2294 · Medium
Sort the values, then start a new group whenever a value strays more than k above the group start.
Open the interactive visualisation