Domanda di colloquio di Hello Alfred

Very basic algorithm coding question