Code not working

time limit exceeded coming

@abhinavgoyal912 in your code when sum==key you have not make any change in left and right therefore your code is stucked in infinite loop

1 Like

@abhinavgoyal912 your code time complexity is o(n2) but since you are not updating left and right variable properly its giving tle

1 Like

got it sir!!! its working now

@abhinavgoyal912 If your doubt has been resolved please close this doubt.