Pregunta de entrevista de Nearform

Just solve the code and write tests