Please tell me why I am getting the wrong answer in N queen problem

@amangupta i think you have provided the wrong code

Sorry about that. Also in the sample output it gives answer 2 for a 4*4 board however the correct answer is 4 please look into that

@amangupta for 4*4 ans is 2 only
the code you gave gives ans 4 for sample but it should be 2

@amangupta your corrected code