← RoseCode

ROSECODE 301

Special Order I

Philippe_57721 · Programming ·


Consider the sequence of characters A B C D, each character being taken twice.

It is possible to order this sequence in such a way that:
- There is 1 character between 2 As
- There are 2 characters between 2 Bs
- There are 3 characters between 2 Cs
- There are 4 characters between 2 Ds

BCD2BAC1AD
BCDBA3CAD
BCDBACA4D

Find the last such order in lexicographic order for the sequence ABCDEFGHIJKLMNOPQRSTUVWXYZ_ (each character is taken twice)


[My timing: < 1 sec]