Amazon interview question

leetcode easy, math type question.