Generate All Permutations Of String Leetcode Problems Javascript