N queen using bitmasks

this approach is only optimising the canPlace() method lookup time.
but if the question was about n kings this approach would be of no use,
because we would have to check for diagonals and rows ,columns at a distance of one only ,
did i get it right?

yes , for n -king problem there wont be much optimisation , because look up area is small

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.