Pregunta de entrevista de Sapiens

A Sum of given numbers: method and answer.