Pergunta de entrevista da empresa Apple

I was asked to invert a binary tree.