代码改变世界

随笔档案-2019年5月24日

[LeetCode] 52. N-QueensII_Hard tag: DFS, backtracking

2019-05-24 10:40 by Johnson_强生仔仔, 267 阅读, 收藏,
摘要: 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 阅读全文

[LeetCode] 51. N-Queens_Hard tag: DFS, backtracking

2019-05-24 10:22 by Johnson_强生仔仔, 249 阅读, 收藏,
摘要: 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 阅读全文

[LeetCode] 47. Permutations II_Medium tag: DFS, backtracking

2019-05-24 09:35 by Johnson_强生仔仔, 257 阅读, 收藏,
摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: Input: [1,1,2] Output: [ [1,1,2], [1,2, 阅读全文

[LeetCode] 46. Permutations_Medium tag: DFS, backtracking

2019-05-24 09:27 by Johnson_强生仔仔, 275 阅读, 收藏,
摘要: Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1, 阅读全文