LeetCode 83: Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.
思路
由于链表已经排好序,所以直接循环查找重复的节点,没什么好说的,比较简单。
代码
C语言版本:
164 / 164 test cases passed.
Status: Accepted
Runtime: 4 ms