上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 98 下一页
摘要: 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) 编辑
摘要: Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be ... 阅读全文
posted @ 2014-11-29 23:29 Jessica程序猿 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Dynamic ProgrammingGivens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", r... 阅读全文
posted @ 2014-11-29 21:38 Jessica程序猿 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ... 阅读全文
posted @ 2014-11-29 20:33 Jessica程序猿 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region... 阅读全文
posted @ 2014-11-29 19:07 Jessica程序猿 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.参考:http://xpentium.blog.163.com/b... 阅读全文
posted @ 2014-11-29 16:20 Jessica程序猿 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog... 阅读全文
posted @ 2014-11-29 14:39 Jessica程序猿 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 98 下一页