Programming Exercises

Build a component that tracks and displays the frequency of each letter in a hardcoded string.

Hard

Problem Statement

Build a component that tracks and displays the frequency of each letter in a hardcoded string.

Sample Input

hello

Sample Output

Frequency: { h: 1, e: 1, l: 2, o: 1 }

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React from "react"; const LetterFrequency = () => { return ( <div> {/* Display the letter frequencies */} </div> ); }; export default LetterFrequency;
Log in or sign up to run or submit your code.Log inSign up
Input
hello
Expected Output
Frequency: { h: 1, e: 1, l: 2, o: 1 }