public ListNode deleteDuplicates(ListNode head) {
        if(head == null || head.next == null)
            return head;
        ListNode root = head;
        while(root.next != null){
            if(root.val == root.next.val)
                root.next = root.next.next;
            else
                root = root.next;
        }
        return head;
    }