#include #include using namespace std; //…

Question Answered step-by-step #include #include using namespace std; //… #include #include using namespace std;// Boolean Testbool ok (int q[], int c, int n){   for (int i = 0; i < c; i++)       // If col difference == row difference, bishop c and i are diagonal to each other.       // row # = q[...] % n       // col # = q[...] / n   return true;}int next (int q[], int c, int n, int k){   static int solutions = 0;      // Base Case   if (){       solutions ++;   }   // Recursion Case   else {       // Bishop index has two situations       if (){           // Position – loop (q[c] – loop)               // if pass the tests                   // go to the next bishop       }       else {           // Position – loop (q[c] – loop)               // if pass the tests                   // go to the next bishop        }   }   return solutions;}int kBishops (int n, int k){   // Dynamic allocate an array in heap base on k (num of bishops)   ;   int sol = next (q, 0, n, k);   // Free up the memory in the heap   ;   return sol;}int main (){   // Declare n and k   int n, k;   // Ask user input for n and k   // n >= k   // If user input -1 for n, terminate the loop   // Otherwise call the kBishop (n, k) function to get the number of solutions   cout << "Enter value of n: ";   cin >> n;   if (n == -1) return 0;   cout << "Enter value of k: ";   cin >> k;   cout << "number of solutions: " << kBishops(n, k) << "n";   return 0;} Hi, can someone help me with this code here? I'd greatly appreciate it as I'm studying for upcoming exams!Thank you! Computer Science Engineering & Technology C++ Programming CS 212 Share QuestionEmailCopy link Comments (0)