Build a component that finds the common elements between two hardcoded arrays and displays them.
HardProblem Statement
Build a component that finds the common elements between two hardcoded arrays and displays them.
Sample Input
Arrays: [1, 2, 3, 4], [3, 4, 5, 6]
Sample Output
Common Elements: [3, 4]
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 CommonElements = () => { return ( <div> {/* Display common elements */} </div> ); }; export default CommonElements;