Java concise iterative solution.
    \n    public ListNode deleteDuplicates(ListNode head) {\n        if (head == null || head.next == null) {\n            return head;\n        }\n        List
        \n    public ListNode deleteDuplicates(ListNode head) {\n        if (head == null || head.next == null) {\n            return head;\n        }\n        ListNode p, dummy = new ListNode(0);\n        p = dummy;\n        dummy.next = head;\n        while (head != null && head.next != null) {\n            if (head.val == head.next.val) {\n                while (head.next != null && head.val == head.next.val) {\n                    head = head.next;\n                }\n                head = head.next;\n                p.next = head;\n            } else {\n                head = head.next;\n                p = p.next;\n            }\n        }\n        return dummy.next;\n    }
['Iterator', 'Java']