1 test case is failing


This is my code. I cannot find any error

lets take an example of array={1,3,4,2,4} and target is 5,then the output will be 1 and 4, 2 and 3,2 and 3 but your code is only giving one 2 and 3.

I ran the code with the array which you example and its giving output both 2and 3,1 and 4

That’s what I am saying two times 1 and 4 should come in the output… Change the code to get the above required output…

remove the break condition

I removed start++ condition in the else loop but still the 3rd test case is failing

okk i got it.lets take an example arr={1,2,3,4,5,6} its answers should be 1 and 5 || 2 and 4 not 3 and 3 but your code is giving 3 and 3 so resolve it by removing = from <= from start<=end…