Amazon interview question

Leetcode style array question (Easy-Medium level)