Company: Flipkart
Difficulty: medium
Binary Tree Path Sum Calculation Problem Description Consider a binary tree with N nodes (1 Root and N-1 descendants). Each node, X is related to Root by some relations such as L, R, LL, LR... and so on, where X is left (L) to Root or left-left (LL) or right-left (RL) to Root and so on. Perform the following operations to find the value of Sum. If the given tree has M leaf nodes, there will be M minimum paths from root to M leaf nodes. Each path, Path i is the path from root to i th leaf node, where 1 <= i <= M. Find all such paths. Concatenate all node values along the Path i to form an integer P i , where 1 <= i <= M. Calculate Sum, where Sum = P 1 + P 2 + ... + P M . Write a program to print Sum. Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the standard output. The following C++ template is provided for your solution: #include <bits/stdc++.h> using namespac