findMinMax finds the minimum and maximum numbers of an array and returns an array containing the minimum and the maximum numbers only.