Divide Array Into Increasing Sequences
Count the largest group of equal values; that many sequences must each reach length k, and dealing the sorted array round-robin builds them.
Count the largest group of equal values; that many sequences must each reach length k, and dealing the sorted array round-robin builds them.