Problem 4036 · Hard

Lexicographically Largest String After Pair Transformations

Each letter stands for a block of powers of two copies of a; split the count greedily from the largest block down to get the greatest string.

Open the interactive visualisation