TLE error plz help


tle error plz help

hi there needs to be an update in the scenario when u find a triplet with sum equal to key

u need to move the left pointer to the position where the next values are equal to the current left pointer
while(left+1 < right and a[left] == a[left+1]) left++;

also the right pointer till where the right pointer points at value with given right pointer value
while(right-1> left and a[right] == a[right-1]) right–;
Updated 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.