String Permutations By Changing Case Leetcode Javascript Question