Example - s = 'a1b'
Input
a1b
Output
['a1b', 'a1B', 'A1b', 'A1B']
For 'a' try 'a' then 'A'; for 'b' try 'b' then 'B'. Digits unchanged.
Full lesson preview
Return all permutations of a string where alphabetic characters can be either lowercase or uppercase.
Problem statement
Task
Examples
Input
a1b
Output
['a1b', 'a1B', 'A1b', 'A1B']
For 'a' try 'a' then 'A'; for 'b' try 'b' then 'B'. Digits unchanged.
Input format
Output format
Constraints
Samples
Input
3z4
Output
['3z4', '3Z4']
Only the letter 'z' has case variations.