Find the minimum and maximum in the array