Permutation 2 Leetcode Solution