摘要: 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... 阅读全文
posted @ 2014-12-31 23:37 LiBlog 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-12-31 23:32 LiBlog 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 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" (... 阅读全文
posted @ 2014-12-31 23:22 LiBlog 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given two strings, find the longest common substring.Return the length of it.NoteThe characters in substring should occur continiously in original str... 阅读全文
posted @ 2014-12-31 23:13 LiBlog 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-12-31 08:33 LiBlog 阅读(1183) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-12-31 07:30 LiBlog 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-12-31 06:39 LiBlog 阅读(2267) 评论(0) 推荐(0) 编辑
摘要: Design an iterator over a binary search tree with the following properties:Elements are visited in ascending order (i.e. an inorder traversal)next() a... 阅读全文
posted @ 2014-12-31 06:14 LiBlog 阅读(363) 评论(0) 推荐(0) 编辑
摘要: The code base version is an integer and start from 1 to n. One day, someone commit a bad version in the code case, so it caused itself and the followi... 阅读全文
posted @ 2014-12-31 05:28 LiBlog 阅读(236) 评论(0) 推荐(0) 编辑