Programming Exercises

Create a component that tracks and displays how many times each button in a group of buttons has been clicked.

Medium

Problem Statement

Create a component that tracks and displays how many times each button in a group of buttons has been clicked.

Sample Input

Buttons: ["Button 1", "Button 2", "Button 3"]

Sample Output

Each button displays its own click count.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React, { useState } from "react"; const ButtonClickTracker = () => { return ( <div> {/* Render buttons with click counts */} </div> ); }; export default ButtonClickTracker;
Log in or sign up to run or submit your code.Log inSign up
Input
Buttons: ["Button 1", "Button 2", "Button 3"]
Expected Output
Each button displays its own click count.