上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 36 下一页
摘要: Design an algorithm to find the kth number such that the only prime factors are 3, 5, and 7. The eligible numbers are like 3, 5, 7, 9, 15 ... Example 阅读全文
posted @ 2014-12-25 07:52 LiBlog 阅读(408) 评论(0) 推荐(0) 编辑
摘要: Given n items with size A[i], an integer m denotes the size of a backpack. How full you can fill this backpack?NoteYou can not divide any item into sm... 阅读全文
posted @ 2014-12-25 05:25 LiBlog 阅读(1687) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of lower alphabetsand a dictionary.Find all words in the dictionary that can be found in the matrix. A word can start from any position... 阅读全文
posted @ 2014-12-25 04:41 LiBlog 阅读(497) 评论(0) 推荐(0) 编辑
摘要: Calculate the an% b where a, b and n are all 32bit integers.ExampleFor 231 % 3 = 2For 1001000 % 1000 = 0ChallengeO(logn)Solution: 1 class Solution { 2... 阅读全文
posted @ 2014-12-25 04:11 LiBlog 阅读(526) 评论(0) 推荐(0) 编辑
摘要: In data structure Hash, hash function is used to convert a string(or any other type) into an integer smaller than hash size and bigger or equal to zer... 阅读全文
posted @ 2014-12-25 01:37 LiBlog 阅读(1971) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.ExampleGiv... 阅读全文
posted @ 2014-12-25 00:30 LiBlog 阅读(704) 评论(0) 推荐(0) 编辑
摘要: Given n distinct positive integers, integer k (k <= n) and a number target. Find k numbers where sum is target. Calculate how many solutions there are 阅读全文
posted @ 2014-12-24 12:47 LiBlog 阅读(916) 评论(0) 推荐(0) 编辑
摘要: BT(binary tree), want to find the LIS(largest independent set) of the BT. LIS: if the current node is in the set, then its children should not be in t... 阅读全文
posted @ 2014-12-24 07:48 LiBlog 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 假设你是harry potter,在grid的左上角,你现在要走到右下角,grid中有正数也有负数,遇到正数表示你的strength增加那么多,遇到负数表示strength减少那么多,在任何时刻如果你的strength小于等于0,那么你就挂了。在一开始你有一定的初始的strength,现在问这个初始... 阅读全文
posted @ 2014-12-24 06:15 LiBlog 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Given an integer array, adjust each integers so that the difference of every adjcent integers are not greater than a given number target.If the array ... 阅读全文
posted @ 2014-12-24 05:40 LiBlog 阅读(329) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 36 下一页