Question: Amazon OA: Check Pair Sum Exists The following function returns a boolean value representing if there is a pair with given sum exists in the

Amazon OA: Check Pair Sum Exists The following function returns a boolean value representing if there is a pair with given sum exists in the array. The following code compiles successfully but fails to return the desired result. Your task is to fix the code so that it passes all test cases. Solve the problem: JAVAS 1, import java.util.*; 2 import java.io.*; 3 import java.lang.*; 9 - 10- public class Solution { public boolean checkPairSumExists(int rows, int cols, int[][] arr, int sum) { Set Integer set new HashSet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
