Luxoft interview question

To write own array method to get avarge