Maxie is the largest number that can be obtained by swapping two digits, Minnie is the smallest. Write a function that takes a number and returns an array of length 2, Maxie and Minnie. Leading zeros are not permitted.
maxMin(12340) ➞ [42310, 10342]
maxMin(98761) ➞ [98761, 18769]
maxMin(9000) ➞ [9000, 9000]
// Sometimes no swap needed.
maxMin(11321) ➞ [31121, 11123]
All inputs are positive, integers.