remove duplicates from sorted list II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
分析
比较cur和cur.next,删除当前节点cur,不动prev,否则移动prev。注意有个continue,处理连续不同dup的情况。
Last updated
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
分析
比较cur和cur.next,删除当前节点cur,不动prev,否则移动prev。注意有个continue,处理连续不同dup的情况。
Last updated