## 26 Apr Aurora Thursday Java 18:00 – 04.29

**Question 1:**

Given an array of number represented by arr and a target sum (n), check if two numbers exists in the array whose sum is equal to the target sum

Sample Test 1:Inputarr = [3, 5, -4, 8, 11, 1, -1, 6] targetsum = 10Output:trueExplanation:The sum of 11 and -1 is 10, which is equal to the targetsum (10), which is why the output is trueSample Test 2:Inputarr = [4, 6, 1, -3] targetsum = 3Output:falseExplanation:In the arr, there are no two numbers whose sum is equal to 3 which is why the output is false

**Question 2:**

Given an array of numbers, print true if all the numbers in the array are indentical otherwise print false.

Note: you can solve this question without a hashset but please try to solve this question using hashset.

Sample Test 1:Inputarr = [2,2,2,2,2]OutputtrueExplanation:All the numbers in the array are identical (all are 2s), due to which the output is trueSample Test 2Inputarr = [9,1,9,9]OutputfalseExplanation:All the numbers in the array are not identical, due to which the output is false

Sorry, the comment form is closed at this time.