Domanda di colloquio di Google

Medium leetcode question and its complexity analysis.