Pergunta de entrevista da empresa Google

Two technical phone interviews back to back, Leetcode medium