Pergunta de entrevista da empresa Google

Basic algorithmic coding question, leetcode style