C # Find root of tree where children sum for every node id is given .
using System ; class GFG { public class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int findRoot ( pair [ ] arr , int n ) {