Problem 1505 · Hard

Minimum Possible Integer After at Most K Adjacent Swaps On Digits

For each position in turn, bring the smallest digit that the remaining swap budget can reach to that position.

Open the interactive visualisation