摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2014-07-05 21:22 OpenSoucre 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.class Solution {public: ... 阅读全文
posted @ 2014-07-05 21:02 OpenSoucre 阅读(143) 评论(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-07-05 20:42 OpenSoucre 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文
posted @ 2014-07-05 18:35 OpenSoucre 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially... 阅读全文
posted @ 2014-07-05 17:32 OpenSoucre 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].题目的意思是将相交得区间合并... 阅读全文
posted @ 2014-07-05 16:31 OpenSoucre 阅读(126) 评论(0) 推荐(0) 编辑