Amazon interview question

very common easy leetcode question, two sum level