TikTok Interview Question

Binary search tree for cousins