上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: Determine the number of bits required to flip if you want to convert integernto integerm.ExampleGivenn=31(11111),m=14(01110), return2.NoteBothnandmare... 阅读全文
posted @ 2015-08-15 10:04 xchangcheng 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Count how many1in binary representation of a 32-bit integer.ExampleGiven32, return1Given5, return2Given1023, return9ChallengeIf the integer isnbits wi... 阅读全文
posted @ 2015-08-15 09:57 xchangcheng 阅读(185) 评论(0) 推荐(0) 编辑
摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文
posted @ 2014-07-12 22:04 xchangcheng 阅读(156) 评论(0) 推荐(0) 编辑
摘要: ay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete at... 阅读全文
posted @ 2014-07-12 21:23 xchangcheng 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum... 阅读全文
posted @ 2014-07-09 22:40 xchangcheng 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes... 阅读全文
posted @ 2014-07-05 23:11 xchangcheng 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possibl... 阅读全文
posted @ 2014-07-05 20:15 xchangcheng 阅读(175) 评论(0) 推荐(0) 编辑
摘要: N-QueensTotal Accepted:9970Total Submissions:38919My SubmissionsThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no tw... 阅读全文
posted @ 2014-07-05 07:45 xchangcheng 阅读(198) 评论(0) 推荐(0) 编辑
摘要: N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.solution:#includ... 阅读全文
posted @ 2014-07-05 07:43 xchangcheng 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl... 阅读全文
posted @ 2014-07-05 07:40 xchangcheng 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 12 下一页