Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ...
分类:
其他好文 时间:
2014-12-31 06:21:14
阅读次数:
281
问题描述:
Say you have an array for which the ith element is the price of a given stock on day
i.
Design an algorithm to find the maximum profit. You may complete at most
two transactions.
Note:
Y...
分类:
其他好文 时间:
2014-12-30 22:08:07
阅读次数:
178
Maximum Product Subarray
Total Accepted: 16617
Total Submissions: 96901
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For exampl...
分类:
其他好文 时间:
2014-12-30 10:09:57
阅读次数:
151
题目:(Sort)Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space....
分类:
其他好文 时间:
2014-12-30 01:45:54
阅读次数:
195
Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there...
分类:
其他好文 时间:
2014-12-28 23:38:24
阅读次数:
271
题目:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,...
分类:
编程语言 时间:
2014-12-28 14:17:01
阅读次数:
213
Maximum Gap
Total Accepted: 2946
Total Submissions: 12695
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear ti...
分类:
其他好文 时间:
2014-12-28 07:07:47
阅读次数:
146
Longest Palindromic Substring-- HARD 级别Question SolutionGiven a string S, find the longest palindromic substring in S. You may assume that the maximum...
分类:
其他好文 时间:
2014-12-27 20:12:16
阅读次数:
136
Given an array with integers.Find two non-overlapping subarrays A and B, which |SUM(A) - SUM(B)| is the largest.Return the largest difference.NoteThe ...
分类:
其他好文 时间:
2014-12-27 06:41:35
阅读次数:
140
Given an integer array with no duplicates. A max tree building on this array is defined as follow:The root is the maximum number in the arrayThe left ...
分类:
其他好文 时间:
2014-12-27 06:37:51
阅读次数:
132