Create a component that finds the longest word in a hardcoded string and displays it.
HardProblem Statement
Create a component that finds the longest word in a hardcoded string and displays it.
Sample Input
The quick brown fox jumped over the lazy dog
Sample Output
Longest Word: jumped
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 LongestWord = () => { return ( <div> {/* Display the longest word */} </div> ); }; export default LongestWord;