Company: Mastercard_2ndaug
Difficulty: medium
Super Node Problem Description A binary tree is described by giving, for every node other than the root, the path from the root down to it. A path is a string of the letters L (go to the left child) and R (go to the right child), so L is the root's left child, RL is the left child of the root's right child, and so on. A node is a Super Node when it has both a left child and a right child, and the digit sum of the left child's value equals the digit sum of the right child's value. Print the sum of the values of all Super Nodes. Read the input from standard input and write the output to standard output. Do not print anything else - any extra text becomes part of the output and fails the test cases. Function Description Complete the function solve : int N : the number of nodes in the tree. long rootVal : the value stored at the root. nodesData : the remaining N - 1 nodes, each given as a path string and a value. Returns the sum of the values of all Super Nodes, or 0 if there are none. Inp