Permutations

Exercise from LeetCode, it is accepted