Micro1 interview question

DSA array based coding question with O(n)