
									 Problem
								
								
									 Solution
								
								
									 Submissions
								
								
							All Permutations of a String
								Certification: Basic Level
								Accuracy: 100%
								Submissions: 2
								Points: 5
							
							Write a C# program to generate and print all possible permutations of a given string. A permutation is a rearrangement of the characters in different orders.
Example 1
- Input: s = "ABC"
 - Output: ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]
 - Explanation: All possible arrangements of the characters 'A', 'B', and 'C' are generated.
 
Example 2
- Input: s = "XY"
 - Output: ["XY", "YX"]
 - Explanation: For the string "XY", there are only two possible permutations.
 
Constraints
- 0 ≤ s.length ≤ 8
 - s consists of lowercase or uppercase English letters.
 - All characters in the input string are distinct.
 - Time Complexity: O(n!)
 - Space Complexity: O(n!)
 
Editorial
									
												
My Submissions
										All Solutions
									| Lang | Status | Date | Code | 
|---|---|---|---|
| You do not have any submissions for this problem. | |||
| User | Lang | Status | Date | Code | 
|---|---|---|---|---|
| No submissions found. | ||||
Solution Hints
- Use a recursive approach to build the permutations.
 - For each position, try placing each available character and then recursively permute the remaining characters.
 - Use backtracking to explore all possible arrangements.
 - Consider using a List<string> to store the results.