Create a component that generates all permutations of a hardcoded string and displays them.
HardProblem 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;
Input
String: 'abc'
Expected Output
Permutations: ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']