Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i...
分类:
其他好文 时间:
2015-05-12 06:57:10
阅读次数:
116
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
? push(x) – Push element x onto stack.
? pop() – Removes the element on top of the stack.
? top()...
分类:
其他好文 时间:
2015-05-12 00:07:56
阅读次数:
132
Minimum Window Substring问题:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n)...
题目传送门1 /*2 求逆序数的四种方法3 */ 1 /* 2 1. O(n^2) 暴力+递推 法:如果求出第一种情况的逆序列,其他的可以通过递推来搞出来,一开始是t[1],t[2],t[3]....t[N] 3 它的逆序列个数是N个,如果把t[1]放到t[N]后面,逆序列个...
分类:
其他好文 时间:
2015-05-10 17:14:39
阅读次数:
133
Edit Distance问题:Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)...
分类:
其他好文 时间:
2015-05-10 12:48:42
阅读次数:
98
控制显示区域各种属性: width - viewport的宽度height – viewport的高度initial-scale - 初始的缩放比例minimum-scale - 允许用户缩放到的最小比例maximum-scale – 允许用户缩放...
分类:
移动开发 时间:
2015-05-06 17:28:39
阅读次数:
294
MinStackTotalAccepted:28489TotalSubmissions:160974MySubmissionsQuestionSolutionDesignastackthatsupportspush,pop,top,andretrievingtheminimumelementinconstanttime.push(x)--Pushelementxontostack.pop()--Removestheelementontopofthestack.top()--Getthetopelement.g..
分类:
其他好文 时间:
2015-05-06 01:34:48
阅读次数:
117
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes...
分类:
其他好文 时间:
2015-05-05 23:48:41
阅读次数:
171
数学题
题意(就是因为读错题意而wa了一次):给一个数字n,范围在[1,2^23-1],这个n是一系列数字的最小公倍数,这一系列数字的个数至少为2
例如12,是1和12的最小公倍数,是3和4的最小公倍数,是1,2,3,4,6,12的最小公倍数,是12和12的最小公倍数………………
那么找出一个序列,使他们的和最小,上面的例子中,他们的和分别为13,7,28,24……显然最小和为7...
分类:
其他好文 时间:
2015-05-05 21:47:17
阅读次数:
158
http://www.programmerinterview.com/index.php/puzzles/minimum-guesses-1-100/Given the numbers 1 to 1000, what is the minimum number of guesses needed t...
分类:
其他好文 时间:
2015-05-05 15:52:42
阅读次数:
234