Write a component that finds the most common number in a hardcoded array and displays it.
HardProblem Statement
Write a component that finds the most common number in a hardcoded array and displays it.
Sample Input
[1, 2, 2, 3, 3, 3, 4]
Sample Output
Most Common Number: 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 MostCommonNumber = () => { return ( <div> {/* Display the most common number */} </div> ); }; export default MostCommonNumber;