Next Permutation Leetcode Java