Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started