Giving wrong ans ? why? i used two pointer approach
@Muskan-Gupta-598128740703036 The problem in your code is, you are also saving the answer even if sum<key, which is not the case.
So make a seperate statement for sum==key. then do the same thing for updating the answer.
i have corrected it , still wa
done !! , actually i missed the full stop