N-queen problem: javascript | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

N-queen problem: javascript

please how do you get the number of possible solutions for the N queen problem? I have tried different methods, none seem to work for me in Javascript. for example, if you have a 7 by 7 chess board, with 7 queens, the solution is 40. what kind of 'decomposing condition' or base condition can i set to make the recursion stop?

29th Jan 2019, 10:22 AM
Marvis Omolu
Marvis Omolu - avatar
1 Resposta
+ 4
#1: Note that each Queen has one unique row and column. #2: Brute Force check
29th Jan 2019, 10:42 AM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar