shopkick Interview Question

basic binary search tree problem.