@@ -0,0 +1,589 @@
+/**%0A * %0A */%0Apackage fish.dreaming.oj.leetcode;%0A%0A/**%0A * @author tao%0A *%0A */%0Apublic class RemoveDuplicatesFromSortedList %7B%0A%09public ListNode deleteDuplicates(ListNode head) %7B%0A%09%09if (head == null) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%0A%09%09int lastVal = head.val;%0A%09%09ListNode pointer = head;%0A%09%09while (pointer.next != null) %7B%0A%09%09%09if (pointer.next.val == lastVal) %7B%0A%09%09%09%09pointer.next = pointer.next.next;%0A%09%09%09%7D else %7B%0A%09%09%09%09lastVal = pointer.next.val;%0A%09%09%09%09pointer = pointer.next;%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return head;%0A%09%7D%0A%0A%09public class ListNode %7B%0A%09%09int val;%0A%09%09ListNode next;%0A%0A%09%09ListNode(int x) %7B%0A%09%09%09val = x;%0A%09%09%09next = null;%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Remove Duplicates From Sorted List