Pregunta de entrevista de Microsoft

Leetcode medium level problems, not very difficult.