If anyone forgets to recall the property mentioned in every answer.
Imagine a tree with a central node and remaining 9 nodes connected to it forming a star-like shape.The central node will have degree 9 and remaining nodes will have degree 1.
So it will give 9 + 9.1 = 18
The reason I suggested this particular example is because it is very easy and quick to draw this tree and calculate the sum of degrees and the reason why it will work is because of the fact they have mentioned just “a tree”.
The tree I have suggested is also “a tree”.