Problem
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create.
Examples
1 | Examples: |
Note
S
will be a string with length at most12
.S
will consist only of letters or digits.
Solution1
Method: Backtracking
Time Complexity:
Space Complexity:
1 | class Solution: |
Solution2 (much faster))
Method: Backtracking
Time Complexity:
Space Complexity:
1 | class Solution: |