摘要:
http://oj.leetcode.com/problems/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.思路:和Remove Duplicates from Sorted Array类似,当已经删除n个元素后,需要保留的 阅读全文
摘要:
http://oj.leetcode.com/problems/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 constant memory.For example,Given i 阅读全文
摘要:
http://oj.leetcode.com/problems/reverse-nodes-in-k-group/Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.You may not alter the values in the nodes, onl 阅读全文