Programming Exercises

Create a component that generates all permutations of a hardcoded string and displays them.

Hard

Problem Statement

Create a component that generates all permutations of a hardcoded string and displays them.

Sample Input

String: 'abc'

Sample Output

Permutations: ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React from "react"; const StringPermutations = () => { return ( <div> {/* Display permutations */} </div> ); }; export default StringPermutations;
Log in or sign up to run or submit your code.Log inSign up
Input
String: 'abc'
Expected Output
Permutations: ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']