← RoseCode

ROSECODE 481

Prüfer Code II

Philippe_57721 · Programming ·

For definitions See problem 480

The file rc481.txt contains 1000 Prüfer codes.

Which code produces the labeled tree whose string representation is the largest in lexicographic order?

Answer format: the string representation corresponding to that code.

Example:
1(3,9(8(25(28(26(7(12(10(19(4,6),24(11,17))),20(14(21(5,23(13(29)))))),22)))),18(15)),30(16(2),27))
This is the string representation for the 1st record of the file

[My timing: instant]