Leetcode#52. N-Queens II
ProblemThe n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.
Given an integer n, return the number of distinct solutions to the n-queens puzzle.
Example 1:
![(https://assets.leetcode.com/uploads/2020/11/13/queens.jpg)
!https://assets.leetcode.com/uploads/2020/11/13/queens.jpg
1234Input: n = 4Output: 2Explanation: There are two distinct solutions to the 4-queens puzzle as shown.
Example 2:
123Input: n = 1Output: 1
Constraints:
...
Leetcode#79. Word Search
進階leetcode212
ProblemGiven an m x n grid of characters board and a string word, return true if word exists in the grid.
The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.
Example 1:
!https://assets.leetcode.com/uploads/2020/11/04/word2.jpg
123Input: board = [["A","B","C","E"],["S","F","C" ...
Leetcode#212. Word Search II
簡易leetcode79
ProblemGiven an m x n board of characters and a list of strings words, return all words on the board.
Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
Example 1:
!https://assets.leetcode.com/uploads/2020/11/07/search1.jpg
123Input: board = [["o","a","a","n"],["e","t",&quo ...