public ListNode deleteDuplicates(ListNode head) {

        if(head == null || head.next == null){
            return head;
        }
        ListNode slowNode = head;
        ListNode fastNode = head.next;

        while(fastNode != null){
            if(fastNode.val == slowNode.val){
                fastNode = fastNode.next;
                slowNode.next = fastNode;
            }else{
                slowNode = slowNode.next;
                fastNode = fastNode.next;
            }
        }
        return head;
    }