> For the complete documentation index, see [llms.txt](https://chiragjain.gitbook.io/neetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chiragjain.gitbook.io/neetcode/784-letter-case-permutation/code.md).

# CODE

```python
class Solution:
    def letterCasePermutation(self, s: str) -> List[str]:
        def helper(idx):
            if idx == len(s):
                return [""]
            res = []
            for x in helper(idx + 1):
                if s[idx].isalpha():
                    res.append(s[idx].swapcase() + x)
                res.append(s[idx] + x)
            return res
        return helper(0)
                    
            
        
```
