Question: language is java Given an array of numbers, find 2 numbers, when added together, comes close to, but does not exceed the specified target value.

language is java

language is java Given an array of numbers, find 2 numbers, when

Given an array of numbers, find 2 numbers, when added together, comes close to, but does not exceed the specified target value. static int bestTwevalues (int numbersll, int target) int value1-0, value2-0 //Here is an example: if numbersI is (40, 10, 46, 23, 22, 16, 27, 6); //if target is 25, output will be "16 6" which totals to 22 - close but not perfect //if target is 26, output will be "10 16" which totals to 26 perfect match! //WRITE YOUR CODE HERE! System out.println (valuel+ ""+ value2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!