thafnhlong / hackerrank-storage

0 stars 0 forks source link

https://www.hackerrank.com/challenges/delete-duplicate-value-nodes-from-a-sorted-linked-list #8

Open thafnhlong opened 2 years ago

thafnhlong commented 2 years ago

p => pointer to ll int cur = p.data; p=p.next; ret => new P(cur); tmp = ret;

while(p!=null){ if(cur != p.data): cur = p.data; tmp.next=new P(cur); tmp=tmp.next; p=p.next; }