Pregunta de entrevista de Google

just leetcode style problems, not much variation.