Marks :100
: 4 | : 1
In a science research lab, combining two nuclear chemicals produces a maximum energy that is the product of the energy of the two chemicals. The energy values of the chemicals can be negative or positive. The scientist wishes to calculate the sum of the energies of the two chemicals which produces maximum energy on reaction.
Write an algorithm to find the sum of energy of the two chemicals which produces maximum energy on reaction.
The first line of the input consists of an integer - numrChem, representing the number of chemicals (N). ($$$0 \le numOfChem \le 10^6$$$)
The second line consists of N space-separated integers- ener*0*, ener*1* ....... ener*N-1* representing the energies of the chemicals.($$$-10^6 \le eneri \le 10^6$$$)
Print an integer representing the sum of energy of the two chemicals which produces maximum energy on reaction
7 9 -3 8 -6 -7 8 10
19
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.