Blackhawk Network Interview Question

LC hard question about binary tree