Build the Graph / Tree
adj = [ [ ] for i in range ( V + 1 ) ] NEW_LINE addEdge ( adj , 1 , 2 ) NEW_LINE addEdge ( adj , 1 , 3 ) NEW_LINE A = [ 1 , - 1 , 1 ] NEW_LINE minOperations = findMinOperation ( adj , A , V ) NEW_LINE print ( minOperations ) NEW_LINE