Domanda di colloquio di Amazon

Trying to answer the math question in a reasonable time