Domanda di colloquio di WNS

Medium level leetcode question on linked list and tree