added solutions for average of an array