# leetcode 19 和leetcode 83

19. Remove Nth Node From End of List

struct ListNode* removeNthFromEnd(struct ListNode* head, int n) {
struct ListNode* ans;
for (int i = 0; i < n; ++i)
{
nex = nex -> next;
}

if (nex == NULL)
{
return ans;
}

while (nex -> next != NULL)
{
pre = pre -> next;
nex = nex -> next;
}
free(pre -> next);
pre -> next = pre -> next -> next;

}

leetcode 83问题描述：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.

struct ListNode* deleteDuplicates(struct ListNode* head) {
{
while(p -> next)
{
if (p -> val != p -> next -> val)
{
p = p -> next;
}
else
{
struct ListNode* tmp = p -> next;
p -> next = p -> next -> next;
free(tmp);
}
}
}
}

public ListNode deleteDuplicates(ListNode head) {
}

#### LeetCode83之Remove Duplicates from Sorted List的Java题解

2015-05-06 09:40:49

#### Leetcode 83

2016-04-11 14:54:22

#### leetcode83题 题解 翻译 C语言版 Python版

2016-02-14 15:02:04

#### [C++]LeetCode: 83 Combinations (回溯法)

2015-01-10 11:00:00

#### Leetcode 83:删除排序链表中的重复元素（最详细解决方案！！！）

2018-06-11 16:35:00

#### Leetcode第83题：删除排序链表中的重复元素

2018-04-17 20:17:10

#### LeetCode_83. 删除排序链表中的重复元素

2018-06-07 14:34:48

#### LeetCode83. 删除排序链表中的重复元素

2018-04-26 11:22:07

#### LeetCode --- 83. Remove Duplicates from Sorted List

2015-04-03 17:06:50