create a method to select the max and min in the given array. And define the range of numbers between max and min.