Pregunta de entrevista de Bloomberg

Algorithm questions with medium level of difficulty