What is the problem with my code?
Yes it worked. But what was the problem?
Now this code doesnt reduce duplicates even after using unique function https://ide.codingblocks.com/s/196183
@tusharnitharwal
You didn’t use unique correctly https://www.geeksforgeeks.org/stdunique-in-cpp/
Use sort(v.begin(),v.end());
before v.erase(unique(v.begin(),v.end()),v.end());
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.