Maximum Swap Leetcode Java