Sponsored
Use these hints if you're stuck. Try solving on your own first.
Traverse the tree keeping the parent and the grandparent.
If the grandparent of the current node is even-valued, add the value of this node to the answer.
Solve with full IDE support and test cases