Count n queen problems wrong answer in 2 test cases


here’s the link to my code, it’s giving error in test case 0 and 4.

When ans is from your if and else if condition, your code prints twice.