题目: 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,- ...
分类:
其他好文 时间:
2017-05-07 23:07:54
阅读次数:
169
题目: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For ...
分类:
其他好文 时间:
2017-05-07 21:58:27
阅读次数:
202
given a 2-d matrix with 0 or 1 values largest square of all 1's dynamic programming, dp[i][j] = 1 + min{dp[i-1][j], dp[i][j-1], dp[i-1][j-1]} if m[i][ ...
分类:
其他好文 时间:
2017-05-07 18:37:21
阅读次数:
182
// poj 2559 Largest Rectangle in a Histogram 栈 // // n个矩形排在一块,不同的高度,让你求最大的矩形的面积(矩形紧挨在一起) // // 这道题用的是数据结构做。也能够递推做。眼下仅仅会数据结构的 // // 对于每一个高度h,求一个左边界L和右边 ...
分类:
其他好文 时间:
2017-05-05 19:22:06
阅读次数:
200
题目 右边大数组中包含了4个小数组,分别找到每个小数组中的最大值,然后把它们串联起来,形成一个新数组。 提示:你可以用for循环来迭代数组,并通过arr[i]的方式来访问数组的每个元素。 提示 Comparison Operators 思路 用 for() 循环遍历可得到大数组中的每一项小数组。 解 ...
分类:
编程语言 时间:
2017-05-05 14:21:05
阅读次数:
164
Maximal Square Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given th ...
分类:
其他好文 时间:
2017-05-01 12:49:55
阅读次数:
199
Largest Rectangle in a Histogram Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10873 Accepted ...
分类:
其他好文 时间:
2017-04-28 22:12:27
阅读次数:
193
传送门 Description You have a positive integer m and a non-negative integer s. Your task is to find the smallest and the largest of the numbers that have ...
分类:
其他好文 时间:
2017-04-22 20:47:52
阅读次数:
231
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2, ...
分类:
其他好文 时间:
2017-04-18 20:56:29
阅读次数:
153
Description 0 s, 1 s and ? Marks Given a string consisting of 0, 1 and ? only, change all the ? to 0/1, so that the size of the largest group is minim ...
分类:
其他好文 时间:
2017-04-18 15:11:45
阅读次数:
131