Pregunta de entrevista de Bloomberg

Easy / medium algorithm questions, very easy