摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.The idea is the same as tha... 阅读全文
posted @ 2014-07-05 15:41 Averill Zheng 阅读(147) 评论(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 15:40 Averill Zheng 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation... 阅读全文
posted @ 2014-07-05 14:55 Averill Zheng 阅读(217) 评论(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.public class Solution { public... 阅读全文
posted @ 2014-07-05 14:10 Averill Zheng 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
posted @ 2014-07-05 08:13 Averill Zheng 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that there will be on... 阅读全文
posted @ 2014-07-05 07:00 Averill Zheng 阅读(158) 评论(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-07-05 05:28 Averill Zheng 阅读(209) 评论(0) 推荐(0) 编辑