Create a program to find all permutations of a string.
MediumProblem Statement
Create a program to find all permutations of a string.
Sample Input
String: "abc"
Sample Output
Permutations: [abc, acb, bac, bca, cba, cab]
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
fun findPermutations(input: String): List<String> {
// Add your code here to generate permutations
}
fun main() {
val input = "abc"
println("Permutations: ${findPermutations(input)}")
}
Input
String: "abc"
Expected Output
Permutations: [abc, acb, bac, bca, cba, cab]