Problem 3551 · Medium

Minimum Swaps to Sort by Digit Sum

Find where each number belongs in the digit-sum order, then count swaps as cycle length minus one.

Open the interactive visualisation