Generate Permutations Leetcode 46