Two Pointers
QihaoD
留个言吧,会很开心的,哈哈
展开
-
[leetCode] Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit原创 2015-05-15 08:02:13 · 364 阅读 · 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.p原创 2015-05-15 01:03:23 · 385 阅读 · 0 评论 -
[leetCode] Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead.For example, given the array [2,3原创 2015-05-15 07:41:48 · 316 阅读 · 0 评论 -
[leetCode] Palindrome Linked List
Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?public class Solution { ListNode h; public boolean isPalindrome(ListNo原创 2015-08-19 00:56:40 · 324 阅读 · 0 评论