Write a component that calculates the Fibonacci sequence up to a given hardcoded number and displays the sequence.
HardProblem Statement
Write a component that calculates the Fibonacci sequence up to a given hardcoded number and displays the sequence.
Sample Input
7
Sample Output
Fibonacci Sequence: [0, 1, 1, 2, 3, 5, 8]
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 FibonacciSequence = () => { return ( <div> {/* Display the Fibonacci sequence */} </div> ); }; export default FibonacciSequence;