Meta Interview Question

a problem related to binary tree