上一页 1 ··· 3 4 5 6 7 8 9 下一页

2015年11月26日

摘要: Minimum SubarrayGiven an array of integers, find the subarray with smallest sum.Return the sum of the subarray.For [1, -1, -2, 1], return -3NoteThe su... 阅读全文
posted @ 2015-11-26 04:36 一心一念 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Kth Largest ElementFind K-th largest element in an array.ExampleIn array [9,3,2,4,8], the 3rd largest element is 4.In array [1,2,3,4,5], the 1st large... 阅读全文
posted @ 2015-11-26 04:05 一心一念 阅读(153) 评论(0) 推荐(0) 编辑

2015年11月25日

摘要: Search Insert PositionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if ... 阅读全文
posted @ 2015-11-25 06:15 一心一念 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Recover Rotated Sorted ArrayGiven a rotated sorted array, recover it to sorted array in-place.Example[4, 5, 1, 2, 3] -> [1, 2, 3, 4, 5]ChallengeIn-pla... 阅读全文
posted @ 2015-11-25 06:04 一心一念 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Merge Sorted Array IIMerge two given sorted integer array A and B into a new sorted integer array.ExampleA=[1,2,3,4]B=[2,4,5,6]return [1,2,2,3,4,4,5,6... 阅读全文
posted @ 2015-11-25 05:26 一心一念 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Have you met this question in a real interview?YesWhich ... 阅读全文
posted @ 2015-11-25 03:16 一心一念 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Remove Duplicates from Sorted Array IIFollow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =... 阅读全文
posted @ 2015-11-25 02:49 一心一念 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Remove Nth Node From End of ListGiven a linked list, remove thenthnode from the end of list and return its head.ExampleGiven linked list: 1->2->3->4->... 阅读全文
posted @ 2015-11-25 02:14 一心一念 阅读(115) 评论(0) 推荐(0) 编辑

2015年11月24日

摘要: Nth to Last Node in ListFind the nth to last element of a singly linked list.The minimum number of nodes in list is n.ExampleGiven a List 3->2->1->5->... 阅读全文
posted @ 2015-11-24 15:05 一心一念 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Add Two NumbersYou have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, suc... 阅读全文
posted @ 2015-11-24 14:14 一心一念 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页

导航