Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-11-18 00:18:35
阅读次数:
182
给定一个排好序的数组,要求里面数字重复的次数不超过2,并且记录在原数组的前头,返回剩余长度。例如给定:A = [1,1,1,2,2,3] 返回 5,并且A = [1,1,2,2,3]思路:用till记录满足条件的下一个位置,以便下一次填入用repeat记录重复的次数,超过2则不理,否则往till里....
分类:
其他好文 时间:
2014-11-18 00:05:44
阅读次数:
228
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:
其他好文 时间:
2014-11-16 14:38:00
阅读次数:
175
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 ....
分类:
其他好文 时间:
2014-11-16 08:14:58
阅读次数:
196
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...
分类:
其他好文 时间:
2014-11-16 08:14:02
阅读次数:
220
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,...
分类:
其他好文 时间:
2014-11-16 08:11:30
阅读次数:
220
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for...
分类:
其他好文 时间:
2014-11-16 08:11:04
阅读次数:
178
Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order...
分类:
其他好文 时间:
2014-11-16 07:07:37
阅读次数:
141
Problem:given an array that contains duplicates (except one value), find the one value that does not have a duplicate in that array. Explain the compl...
分类:
其他好文 时间:
2014-11-15 06:35:12
阅读次数:
202
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new lengt...
分类:
其他好文 时间:
2014-11-14 20:52:34
阅读次数:
154