// N-Queens II class Solution { private: int c, n; public: int totalNQueens(int n) { this->n = n; c = 0; f(n, 0, 0, 0); return c; } void f(int i, int l, int m, int r) { if (! i) c++; else for (int x = (1<>1); } } };