Pergunta de entrevista da empresa Amazon

math questions were useless, made no sense