Maximum Swap Leetcode Javascript Problems