Array Education interview question

Solve our problems for free