@@ -0,0 +1,1141 @@
+package leetCode;%0D%0A%0D%0A/*%0D%0A * Link : https://leetcode.com/problems/remove-duplicates-from-sorted-list/%0D%0A */%0D%0A%0D%0Apublic class _083RemoveDuplicatesSortedList %7B%0D%0A%09 public static ListNode deleteDuplicates(ListNode head) %7B%0D%0A%09        if(head == null %7C%7C head.next == null)%0D%0A%09            return head;%0D%0A%09 %0D%0A%09        ListNode prev = head;    %0D%0A%09        ListNode p = head.next;%0D%0A%09 %0D%0A%09        while(p != null)%7B%0D%0A%09            if(p.val == prev.val)%7B%0D%0A%09                prev.next = p.next;%0D%0A%09                p = p.next;%0D%0A%09            %7Delse%7B%0D%0A%09                prev = p;%0D%0A%09                p = p.next; %0D%0A%09            %7D%0D%0A%09        %7D%0D%0A%09 %0D%0A%09        return head;%0D%0A%09    %7D%0D%0A%09static class ListNode %7B%0D%0A%09%09int val;%0D%0A%09%09ListNode next;%0D%0A%09%09ListNode(int x) %7B val = x; %7D%0D%0A%09%7D%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09ListNode ln=new ListNode(1);%0D%0A%09%09ln.next=new ListNode(1);%0D%0A%09%09ln.next.next=new ListNode(2);%0D%0A%09%09ln.next.next.next=new ListNode(3);%0D%0A%09%09ln.next.next.next.next=new ListNode(3);%0D%0A%09%09ln.next.next.next.next.next=new ListNode(4);%0D%0A%09%09ln=deleteDuplicates(ln);%0D%0A%09%09System.out.println(%22HERE%22);%0D%0A%09%09while(ln!=null)%7B%0D%0A%09%09%09System.out.println(ln.val);%0D%0A%09%09%09ln=ln.next;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D

remove duplicates from linked list completed