change max and min position of an array with some given numbers