Remove Duplicates from Sorted List


#1

I got TLE. Any help?

My submission: https://ideone.com/W8LFjB


#2

check this out, i’ve edited your code


#3

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


#4

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


#5

@Callisto Thanks.
I edited the code, but this time I am getting garbage in the list: https://ideone.com/H1Mibv