Update appNew update is available. Click here to update.
sidenav-btnClose
Topic list
Letter Case Permutation
MEDIUM
15 mins
Strings
Topics (Covered in this problem)
Problem solved
Badge
Skill meter
Strings
-
-
Other topics
Problem solved
Badge
Skill meter
Matrices (2D Arrays)
-
-
Linked List
-
-
Sorting
-
-
Binary Search
-
-
Stacks & Queues
-
-
Trees
-
-
Graph
-
-
Dynamic Programming
-
-
Greedy
-
-
Tries
-
-
Arrays
-
-
SQL
-
-
Binary Search Trees
-
-
Heap
-
-
Bit Manipulation
-
-
Solve problems & track your progress
Checkout your overall progress in every topic here
Become
userLevel
Sensei
in DSA topics
Open the topic and solve more problems associated with it to improve your skills
Check out the skill meter for every topic
See how many problems you are left with to solve for cracking any stage. Score more than zero to get your progress counted.

Letter Case Permutation

Contributed by
Yash_5830
Medium
yellow-spark
0/80
Avg time to solve 15 mins
Success Rate 85 %
Share
0 upvotes

Problem Statement

You are given a string 'S'. Your task is to find an array of all possible strings in any order that can be formed by transforming every letter individually to the lowercase or the uppercase.

Note:

1. You can print the array in any order.

2. The string 'S' only contains English alphabets and digits.
Detailed explanation ( Input/output format, Notes, Constraints, Images )
Sample Input 1:
1
a1b
Sample Output 1:
A1B A1b a1B a1b
Explanation for sample input 1:
These are the four strings that we can get after transforming every letter individually to be lowercase or uppercase.
Sample Input 2:
1
0
Sample Output 2:
0
Explanation for sample input 2:
There is no alphabet in the string, so we get the output same as the input string.
Reset Code
Full screen
Auto
copy-code
Console