public ListNode deleteDuplicates(ListNode head) {
        if (head == null || head.next == null) {
            return head;
        }
        
        ListNode crt = head;
        while (crt != null) {
            ListNode it = crt;
            while (it.next != null && it.next.val == crt.val) {
                it = it.next;
            }
            crt.next = it.next;
        }
        return head;
    }