Logic is correct, still not getting correct output. Can you pls check out my code

problem link: https://practice.geeksforgeeks.org/problems/remove-duplicates/0

code link : https://ide.codingblocks.com/s/291641

@amitqy,
Add cin.ignore(1); before while loop.

can you pls tell what was the problem and how did it get resolved ?

@amitqy,
It has lengthy theory about how iostream works and how get line works, which is pretty boring. For now, you can skip this, and please attempt problems from reliable sources so that you don’t get stuck in boring things. Use Hackerblocks, for e.g, there the problems are well written and designed.

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.