Merging child nodes to get parent node . Since set is used , it will remove redundant digits .
for ( auto it : Tree [ 2 * idx ] ) { Tree [ idx ] . insert ( it ) ; } for ( auto it : Tree [ 2 * idx + 1 ] ) { Tree [ idx ] . insert ( it ) ; } }