摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
Remove Duplicates from Sorted Array IIFollow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =... 阅读全文
摘要:
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->... 阅读全文
摘要:
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->... 阅读全文
摘要:
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... 阅读全文