摘要: 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-11-30 21:20 Jessica程序猿 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.#include#include#includeusi... 阅读全文
posted @ 2014-11-30 20:28 Jessica程序猿 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc... 阅读全文
posted @ 2014-11-30 19:37 Jessica程序猿 阅读(265) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2014-11-30 18:32 Jessica程序猿 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA... 阅读全文
posted @ 2014-11-30 09:45 Jessica程序猿 阅读(171) 评论(0) 推荐(0) 编辑