Pergunta de entrevista da empresa Google

Nothing found on leetcode, more specific to google but can use same concepts