Remove Duplicates from Sorted List


I got TLE. Any help?

My submission:


check this out, i’ve edited your code


Thanks but I need to know why my code gives TLE though it is linear approach.


you’re getting a tle because your base condition is not reachable…while()


@Callisto Thanks.
I edited the code, but this time I am getting garbage in the list: