Leetcode: Remove Duplicates from Sorted List
来源:互联网 发布:淘宝旺旺mac版 编辑:程序博客网 时间:2024/06/06 07:49
http://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *deleteDuplicates(ListNode *head) { // Start typing your C/C++ solution below // DO NOT write int main() function if(head==NULL) return head; while(head->next!=NULL&&head->val==head->next->val){ head->next=head->next->next; } deleteDuplicates(head->next); return head; }};
- Remove Duplicates from Sorted List :from LeetCode
- Leetcode - List - Remove Duplicates from Sorted List
- [leetcode][list] Remove Duplicates from Sorted List
- [leetcode][list] Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List
- [Leetcode] Remove Duplicates from Sorted List II
- LeetCode: Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List II
- leetcode 37: Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List II
- [LeetCode]Remove Duplicates from Sorted List
- Leetcode: Maximum Depth of Binary Tree
- Leetcode: Reverse Integer
- Leetcode: Symmetric Tree
- Leetcode: Merge Sorted Array
- Leetcode: Climbing Stairs
- Leetcode: Remove Duplicates from Sorted List
- Leetcode: Search Insert Position
- Leetcode: Remove Duplicates from Sorted Array
- JS限制textbox或textarea输入字符长度
- Leetcode: Convert Sorted Array to Binary Search Tree
- Leetcode: Unique Binary Search Trees
- Leetcode: Remove Element
- Leetcode: Populating Next Right Pointers in Each Node
- Leetcode: Maximum Subarray