Remove
所难
这个作者很懒,什么都没留下…
展开
-
LeetCode-Remove Duplicates from Sorted Array
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 another array, you must do this in place with原创 2014-08-17 19:09:30 · 254 阅读 · 0 评论 -
LeetCode-Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.S原创 2014-08-17 19:03:41 · 274 阅读 · 0 评论 -
LeetCode-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.Solution:Code:原创 2014-08-08 18:20:37 · 181 阅读 · 0 评论 -
LeetCode-Remove Duplicates from Sorted List II
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->原创 2014-08-08 18:15:48 · 315 阅读 · 0 评论 -
LeeCode-Remove Duplicates from Sorted Array II
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,原创 2014-08-09 08:37:23 · 224 阅读 · 0 评论