Pregunta de entrevista de Google

Look on leetcode for similar problems