Maximum Swap Leetcode Problems Python