Given an array of integers, swap the the maximum and minimum. If the maximum or minimum occurs more than once, swap all of them.