Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a program to find all permutations of a string.

Medium

Problem 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)}") }
Log in or sign up to run or submit your code.Log inSign up
Input
String: "abc"
Expected Output
Permutations: [abc, acb, bac, bca, cba, cab]