Permutation Leetcode Problem 1