https://ide.codingblocks.com/s/238051 sir can you tell me why it is showing tle in this code and give me suggestion to correct it
Targeated sum pair
@anuragavm123
Your code is giving TLE because it always stuck in infinite loop. See when your cs==s you are neither increasing i nor decreasing j, so your i and j remain always same and your code get stuck in infinite loop. To solve this just write i++; j–; after line 31
Sir after doing that it is showing wrong test case
@anuragavm123
Then you can use two nested loop to check all possible pairs.
for i=0 to i<n
for j=i+1 to j<n
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.