public static Node<Integer> removeDuplicateLeaveDistinct(Node<Integer> head) {
       if(head == null || head.next == null) {
           return head;
       }

       Node<Integer> front = head;
       Node<Integer> prev = null;
       while(front!= null) {

           int data = front.data;
           Node<Integer> cursor = front.next;
           while(cursor!= null && cursor.data.equals(data)) {
               cursor = cursor.next;
           }

           if(cursor != front.next) {
               if(prev == null) {
                   head = cursor;
                   front = cursor;
               } else{
                   prev.next = cursor;
                   front = cursor;
               }
           } else{
               prev = front;
               front = front.next;
           }

       }

       return head;
   }