Amazon Interview Question

Binary tree question and it went well