PS interview question

Code to invert a tree