Maximum Number of Groups With Increasing Length
Binary search the number of groups and check with a Gale-Ryser style count whether groups of sizes 1 to k can be filled.
Binary search the number of groups and check with a Gale-Ryser style count whether groups of sizes 1 to k can be filled.