Write a component that finds all subsets of a hardcoded array and displays them.
HardProblem Statement
Write a component that finds all subsets of a hardcoded array and displays them.
Sample Input
[1, 2, 3]
Sample Output
Subsets: [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React from "react"; const FindSubsets = () => { return ( <div> {/* Display all subsets */} </div> ); }; export default FindSubsets;