3 ms·
Where there other constraints on your N-queens? (no bruteforce? no backtracking? must run in X time?)
by gburt 14y ago
Where there other constraints on your N-queens? (no bruteforce? no backtracking? must run in X time?)
- somethingnew 14y agoReally it was just write code to verify whether it can be done or not (return boolean) based on the N input (integer). Without having to write code it would return true for N >= 4, but I didn't know that. I was just trying to get an initial solution down with recursion, not thinking about backtracking yet or worst case time (which was probably 2^N).