Skip to content

Latest commit

 

History

History
executable file
·
11 lines (6 loc) · 352 Bytes

51.md

File metadata and controls

executable file
·
11 lines (6 loc) · 352 Bytes

51. N-Queens

Classical Questios. We can just use DFS.

We can place a queen everywhere until we cannot find a place to place the queen.

I write a really ugly dfs algorithm. Then TLE...

I need to speed it up.

I shall not use a n^2 loop to place the queen. I need to use to place a queen in current row! Yes! After this way, I pass this problem!