Amazon interview question

DSA question based on array but very difficult