Solving Avg and count  Array