摘要: Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now [1,1,2,2,3]. class Solution {public: int removeDuplicates(int A[], int n) { // Start typing your C/C++ solut. 阅读全文
posted @ 2013-04-28 11:24 冰点猎手 阅读(118) 评论(0) 推荐(0)
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1->1->2->3, return 2->3. /** * Definition for singly-linked list. * str 阅读全文
posted @ 2013-04-28 00:21 冰点猎手 阅读(141) 评论(0) 推荐(0)