Question: Java simple small coding /** * In this problem, you are given an integer X and an array of integers. Find * the pair of
Java simple small coding


/** * In this problem, you are given an integer X and an array of integers. Find * the pair of integers in the array whose sum is equal to X, and return the * pair of integers as an array with the smaller number first, If there are no * pairs that work, return an empty array. There will only ever be one pair that * works, if any. * * Examples: * * 8[2,10,1,5,7,4] returns [1, 7] * * 11[9,17,5,21,10] returns [-10, 21] * * 5 [8, 12,16,20] returns [ ] */ public static int[] findPair(int target, int[] array) \{ \} throw new Unsupported0perationException("TOD0: delete this statement.")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
