Create a component that calculates all pairs in a hardcoded array whose sum equals a hardcoded target value.
HardProblem Statement
Create a component that calculates all pairs in a hardcoded array whose sum equals a hardcoded target value.
Sample Input
Array: [1, 2, 3, 4, 5] Target: 6
Sample Output
Pairs: [[1, 5], [2, 4]]
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 PairSum = () => { return ( <div> {/* Display pairs */} </div> ); }; export default PairSum;