Given two values k1 and k2 (where k1 searchRange(TreeNode root, int k1, int k2) {19 ArrayList res = searchRangeRecur(root,k1,k2);20 r...
分类:
其他好文 时间:
2015-01-01 01:28:39
阅读次数:
135
Given n items with size A[i] and value V[i], and a backpack with size m. What's the maximum value can you put into the backpack?NoteYou cannot divide ...
分类:
其他好文 时间:
2015-01-01 01:24:21
阅读次数:
168
As the title described, you should only use two stacks to implement a queue's actions.The queue should support push(element), pop() and top() where po...
分类:
其他好文 时间:
2015-01-01 01:24:17
阅读次数:
202
Given two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.ExampleFor "ABCD" and "EDCA", the LCS is "A" (...
分类:
其他好文 时间:
2015-01-01 00:12:17
阅读次数:
122
Given an array of integers, find the subarray with smallest sum.Return the sum of the subarray.NoteThe subarray should contain at least one integer.Ex...
分类:
其他好文 时间:
2015-01-01 00:08:45
阅读次数:
135
Given a string which contains only letters. Sort it by lower case first and upper case second.NoteIt's not necessary to keep the original order of low...
分类:
其他好文 时间:
2015-01-01 00:05:48
阅读次数:
313
Given two strings, find the longest common substring.Return the length of it.NoteThe characters in substring should occur continiously in original str...
分类:
其他好文 时间:
2015-01-01 00:01:16
阅读次数:
339
Compare two strings A and B, determine whether A contains all of the characters in B.The characters in string A and B are all Upper Case letters.Examp...
分类:
其他好文 时间:
2014-12-31 08:42:03
阅读次数:
228
Count the number of k's between 0 and n. k can be 0 - 9.Exampleif n=12, in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], we have FIVE 1's (1, 10, 11, 12...
分类:
其他好文 时间:
2014-12-31 08:41:07
阅读次数:
507
For given numbers a and b in function aplusb, return the sum of them.NoteYou don't need to parse the input and output. Just calculate and return.Examp...
分类:
其他好文 时间:
2014-12-31 07:36:50
阅读次数:
253