Goldman Sachs Interview Question

HackerRank : Invert a Binary Tree