Shyplite Interview Question

binary tree question from frontend to backend