Fork me on GitHub
摘要: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 思路: 典型8皇后,回溯法,验证是否能放皇后位置, 阅读全文
posted @ 2017-06-05 13:45 hellowOOOrld 阅读(133) 评论(0) 推荐(0) 编辑
摘要: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all 阅读全文
posted @ 2017-06-05 10:59 hellowOOOrld 阅读(151) 评论(0) 推荐(0) 编辑