the answer should be 10.
in a tree
the degree of a node in tree is the number of child it has
so if a node has degree 3, it has 3 child and 1parent(except root)
so 3 vertex of degree 4 contribute 3*5 in degree sum
lly remaining vertex of degree 3 contribute (x-3)*4
also we do -1 as root has no parent.
total degree sum=21*2=42.
3*5 + (x-3)*4 - 1 =42
gives x=10.