nQueens count Problem

My code attached below is not working for n = 11
I’m getting two wrong answers on submission

hey @krishnamanohar199, intialise the array with zero. One more change is needed in backtracking step.
I have made changes to your code only check it here https://ide.codingblocks.com/s/97500

Hey Gaurav,
How is it different from my code? The changes made were the reverse of my code aren’t they?
I did backtrack if the recursive call was false as well.

hey @krishnamanohar199, backtracking is must in this question, in your code you are doing backtracking only when a condition gets true.

1 Like

hey @krishnamanohar199 , if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved

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.