Sum of Nodes and respective Neighbors on the path from root to a vertex V
Given a rooted tree having N vertices, an array values[ ], which represents the value assigned to each node, and a vertex V, the task is to calculate the sum of values of nodes and immediate neighbors lying in the path from the root(always 0) to V. Examples: Input: N = 8, values = {1, 2, 3, 0, 0, 4,