Skip to content

Instantly share code, notes, and snippets.

View MajoRoth's full-sized avatar
🎯
Focusing

MajoRoth

🎯
Focusing
View GitHub Profile
@MajoRoth
MajoRoth / nQueen.java
Created May 25, 2020 10:02
Solve the N-Queen problen for NxN array.
class nQueen {
/**Solves the N queen problem for any squared board.
* solve() returns true when it finds a solution.
* in valid() you can set certain slots invalid in
* order to observe different solutions.
* 0 --> Empty slot.
* 1 --> A queen.
*/