Problem 1286 · Medium

Iterator for Combination

Generate combinations in lexicographic order by advancing the rightmost position that can still move.

Open the interactive visualisation