Skip to content

Latest commit

 

History

History

remove-duplicates-from-sorted-list-ii

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Recursion

take two nodes from the linked list, if the first's val equals to the , we can sure that the first node is unique. just append deleteDuplicates(second) to the first one.

if they equals to each other, we can sure that they should be removed. search through the linked list, remove all nodes until a different one is appeared.