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

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
Get step-by-step solutions from verified subject matter experts
