We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicstaticNoderemoveDuplicates(Nodehead){//Write your code here//My answerif(head.nextisnotnull){Nodenext=head.next;while(next.nextisnotnull){Nodenext2=next.next;if(next.data==next2.data){next.next=next2.next;}else{next=next.next;}}next=head.next;if(head.data==next.data){head.next=next.next;}}returnhead;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 24: More Linked Lists
You are viewing a single comment's thread. Return to all comments →
C#