give root binary tree flatten tree link listThe link list use TreeNode class right child pointer point node list leave child pointer nullthe link list order preorder traversal binary tree Example 1input root 12534null6output 1null2null3null4null5null6example 2input root Output Example 3input root 0output 0 constraintsthe number nod tree range 0 2000100 Nodeval 100 Follow can flatten tree inplace o1 extra space