human
Find root of the tree where children id sum for every node is given | Find root of tree where children sum for every node id is given.
Every node appears once as an id , and every node except for the root appears once in a sum . So if we subtract all the sums from all the ids , we 're left  with the root id..
Driver Code"
Solution in Python:
 Write me a code to find root of the tree where children id sum for every node is given and the other steps required?
assistant
#Here is code to find root of the tree where children id sum for every node is given and the other steps required.
 def findRoot ( arr , n ) :
	root = 0
	for i in range ( n ) :
		root += ( arr [ i ] [ 0 ] - arr [ i ] [ 1 ] )
	return root
if __name__ == ' _ _ main _ _ ' :
	arr = [ [ 1 , 5 ] , [ 2 , 0 ] , [ 3 , 0 ] , [ 4 , 0 ] , [ 5 , 5 ] , [ 6 , 5 ] ]
	n = len ( arr )
	print ( findRoot ( arr , n ) )