getMaxIdx -- computes the index of the max element in an array input array output idx the index of the max element in array