摘要:
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 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.ExampleGiv... 阅读全文