MCPcopy Create free account
hub / github.com/Hsinha11/Leetcode-solutions / addSol

Method addSol

-51-N_Queens/Code.cpp:19–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 }
18
19 void addSol(vector<vector<int>>& board, int n, vector<vector<string>>& ans) {
20 vector<string>arr;
21 for(int i = 0; i < n; i++) {
22 string str = "";
23 for(int j = 0; j< n; j++) {
24 if(board[i][j] == 1) str.push_back('Q');
25 else str.push_back('.');
26 }
27 arr.push_back(str);
28 }
29 ans.push_back(arr);
30 }
31
32 void solve(vector<vector<int>>& board, int n, int col, vector<string>& v, vector<vector<string>>& ans) {
33 if(col == n) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected