Why is it showing wrong answer for 2 test cases?
Why is it showing wrong answer for 2 test cases?
since negative numbers are also allowed it is possible that sum > key but still sum + a[i] == key, i have changed your code a little please check
Code
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.