Pregunta de entrevista de Jane Street

Excel task, simple functions are enough