Everpure Interview Question

Code out the solution to the Binary tree question asked