Java simple and clean code with comment
public class Solution {\n    public ListNode deleteDuplicates(ListNode head) {\n    \t//use two pointers, slow - track the node before the dup nodes, \n    \t//
    public class Solution {\n    public ListNode deleteDuplicates(ListNode head) {\n    \t//use two pointers, slow - track the node before the dup nodes, \n    \t// fast - to find the last node of dups.\n        ListNode dummy = new ListNode(0), fast = head, slow = dummy;\n        slow.next = fast;\n        while(fast != null) {\n        \twhile (fast.next != null && fast.val == fast.next.val) {\n         \t\tfast = fast.next;    //while loop to find the last node of the dups.\n        \t}\n        \tif (slow.next != fast) { //duplicates detected.\n        \t\tslow.next = fast.next; //remove the dups.\n        \t\tfast = slow.next;     //reposition the fast pointer.\n        \t} else { //no dup, move down both pointer.\n        \t\tslow = slow.next;\n        \t\tfast = fast.next;\n        \t}\n        \t\n        }\n        return dummy.next;\n    } }
['Java']