I got the answer but its not coming in correct series. please help with the code

hi @akshat1409,
u need to print unique triplet
refer https://ide.codingblocks.com/s/656672 ive commented the code

but your code is giving the wrong output. it gives an extra answer which has repeated digits

@akshat1409 digits can repeat triplets can’t…

why have we used #include<algorithm?? and how can we write while(a[j] == second)j++; while(a[k] == third)k–; directly? I cant see any curly braces showing the start of any work. what does this mean? writing it out of the blue??

what is the meaning of while(a[i] == first)i++;i–;?? why are we adding one and then subtracting it at the same time??

hi @akshat1409 do a dry run those things are done to avoid duplicacy, sort fn is in algorithm thats y

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.