Question: Given an array of n integer numbers, and an int number x. write a function to find out whether the sum of any two numbers

Given an array of n integer numbers, and an int number x. write a function to find out whether the sum of any two numbers in the array equals x or not. class FindPair { public static void findPair(int[] A, int x) {...... } public static void main (String[] args) { int A[] = { 8, 7, 2,5, 3, 1 }; int sum = 10; findPair(A, sum); } } Output Pair found at index 0 and 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
