Solution (source code)

= Solution
{c}

In a <Prüfer code>, a vertex label occurs exactly its degree minus one times. A rooted binary tree with $2m+1$ vertices has one root of degree two, $m-1$ other interior vertices of degree three, and $m+1$ leaves. Its code of length $2m-1$ therefore has \b[one label occurring once, $m-1$ labels occurring twice, and all other labels absent].

Conversely, these multiplicities force exactly those degrees in the tree decoded from the sequence. The unique once-occurring label is its root. This is the complete characterization.