Write a function that finds the maximum or minimum number in an array