Apply Operations to Make String Empty
Only the last copy of each letter with the largest count survives until the final round, so the answer keeps those positions in order.
Only the last copy of each letter with the largest count survives until the final round, so the answer keeps those positions in order.