Amazon interview question

DSA array type medium questions