codedecks-in / LeetCode-Solutions

This repository consists of solutions to the problem from LeetCode platform. Subscribe to our Channel for more updates
https://www.youtube.com/c/codedecks
MIT License
821 stars 415 forks source link

Code n queen leetcode 51 #443

Closed Shubh2003 closed 2 months ago

Shubh2003 commented 11 months ago

fix:#443 added code for N-Queens in c++

Description

1.We need a vector of vector , so, first we will make a string. 2.Then we will check that according to the current vector can we push the new string formed. 3.For making new string we will check in which index of the string the Q must be placed. For which we will put Q at every index. 4.If we are able to find the string, we push it to vector and call a recursion to push the next string. 5.When the size of vector will be n, we will push it to the vector.

welcome[bot] commented 11 months ago

I can tell this is your first pull request! Thank you I'm so honored. :tada::tada::tada: I'll take a look at it ASAP!