Amazon interview question

Easy leetcode question was asked