Apple Interview Question

invert the binary tree with the most optimal solution