Microsoft interview question

questions was about algorithm with array manipulation