A queue of pairs to do bfs traversal and keep track if the node is a left or right child if boolean value is true then it is a left child .
queue < pair < Node * , bool > > q ; q . push ( { root , 0 } ) ; int sum = 0 ;