a little bit confused for line 12, why do cur = next.next here?
For example if we have a list with three same value like 1 -> 2 -> 2 -> 2 -> 3 ->4, when 'curr' point to the first 2, 'next' point to the second 2, line 12 will jump 'curr' to the third 2 and 'next' to 3. so the third 2 will be kept in the list.