Marks :10
: 11 | : 0
You are given an array $$$A$$$ of $$$N$$$ integers and an integer $$$K$$$. You have to tell whether there exist three integers whose sum is equal to K. You can't use the integer at the same index twice. You have to print "Yes" if there exist such integers, otherwise "No". You can print "Yes" and "No" in any case.
First line contains two integers N K $$$(3 \le N \le 10^3)$$$ - Number of integers in the array, $$$(0 \le K \le 10^9)$$$ - Target value
The next line contains N integers A1, A2, A3 ... An $$$(-10^8 \le Ai \le 10^8)$$$ - Element of the array A.
Single line containing $$$True$$$ if the integers exist, otherwise $$$False$$$
5 8 1 2 3 4 5
Yes
5 10 1 2 3 4 -1
No
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.