Marks :10
: 11 | : 1
You are given an array $$$A$$$ of $$$N$$$ integers and an integer $$$K$$$. You have to find two integers whose sum is equal to K. You can assume that each problem has a unique solution and the solution always exists. You can't use the same integer twice. Output the integers in ascending order.
First line contains two integers N K $$$(2 \le N \le 2 ⋅ 10^5)$$$ - Number of integers in the array, $$$(0 \le K \le 10^9)$$$ - Target value
The next line contains N integers A1, A2, A3 ... An $$$(1 \le Ai \le 10^8)$$$ - Element of the array A.
Two integers from the array A sorted in Ascending Order whose sum is equal to K
5 8 1 2 3 4 5
3 5
5 12 7 3 5 8 1
5 7
Here, we can see that (3+5=8) Therefore answer is 3 5
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.