Get the maximum and minimum values in an array.