My accepted Java code
public ListNode deleteDuplicates(ListNode head) {\n            if(head==null) return null;\n            ListNode FakeHead=new ListNode(0);\n            FakeHead
    public ListNode deleteDuplicates(ListNode head) {\n            if(head==null) return null;\n            ListNode FakeHead=new ListNode(0);\n            FakeHead.next=head;\n            ListNode pre=FakeHead;\n            ListNode cur=head;\n            while(cur!=null){\n                while(cur.next!=null&&cur.val==cur.next.val){\n                    cur=cur.next;\n                }\n                if(pre.next==cur){\n                    pre=pre.next;\n                }\n                else{\n                    pre.next=cur.next;\n                }\n                cur=cur.next;\n            }\n            return FakeHead.next;\n        }
[]