Given is an array of integers. Element is called an extreme if no other element's value is more distant from the average. Write a function
int extreme(int[] A);
that given an array of integers returns the index of an extreme (any one of them if there are many).
If no extreme exists, the function should return -1.
A[0]=9, A[1]=4, A[2]=-3, A[3]=-10
the index of an extreme is 3, because the average of the array is
(9 + 4 + (-3) + (-10)) / 4 = 0
and in this array no value is further from 0 than -10
2