topic:
Thought:
直接simulation,Determine horizontal,Vertical,Whether the queen on the diagonal line exists,if it exists,Just record,Last return。
The answer method is similar to mine,But more concise,Go out of the king,The first queen that recording encountered。
Code:
1 | class Solution: |
1 | class Solution: |