https://leetcode.com/problems/maximum-swap/

Runtime: 36 ms, faster than 11.89% of Python3 online submissions for Maximum Swap.
Memory Usage: 14.3 MB, less than 25.32% of Python3 online submissions for Maximum Swap.

```python
import itertools

class Solution:
    def maximumSwap(self, num: int) -> int:
        """
        #6:24
        old_nums = [int(i) for i in list(str(num))]
        num_list = [[index,i] for index,i in enumerate(old_nums)]
        
        num_list.sort(key=lambda item: item[1])
        
        min_value = num_list[0]
        max_value = num_list[-1]
        
        if (min_value[0] < max_value[0]):
            old_nums[min_value[0]] = max_value[1]
            old_nums[max_value[0]] = min_value[1]
            return int("".join([str(i) for i in old_nums]))
        else:
            return num
        #6:34
        """
        #6:34
        nums = [int(i) for i in list(str(num))]
        num_list = [[index,i] for index,i in enumerate(nums)]
        #print(num_list)
        
        results = [num]
        for subset in itertools.combinations(num_list, 2):
            a = subset[0]
            b = subset[1]
            old_nums = nums.copy()
            old_nums[a[0]] = b[1]
            old_nums[b[0]] = a[1]
            results.append(int("".join([str(i) for i in old_nums])))
        
        if (len(results) > 0):
            return max(results)
        else:
            return num
        #6:57
```
