Programming Exercises

Build a component that finds the maximum product of any two numbers in a hardcoded array and displays the result.

Hard

Problem Statement

Build a component that finds the maximum product of any two numbers in a hardcoded array and displays the result.

Sample Input

Array: [5, -2, 3, 1, -4]

Sample Output

Maximum Product: 20

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React from "react"; const MaxProduct = () => { return ( <div> {/* Display the maximum product */} </div> ); }; export default MaxProduct;
Log in or sign up to run or submit your code.Log inSign up
Input
Array: [5, -2, 3, 1, -4]
Expected Output
Maximum Product: 20