Problem with this problem

i have solved this problem without using backtracking, and getting the correct answer. But on submission , its showing wrong answer.
Here’s my code :
#include<bits/stdc++.h>
using namespace std;

// int count = 0;

int class_Assign (int ans, int n, char prev) {
if (ans == n) {
// cout << out << endl;
// count++;
return 1;
}
int count = 0;
//rec
if (prev == ‘a’) {
count += class_Assign (ans+1, n, ‘a’) + class_Assign (ans + 1, n, ‘b’);
}
else {
count += class_Assign (ans + 1, n, ‘a’);
}
return count;
}

int main() {
int t;
cin >> t;
while (t–) {
int n;
cin >> n;
cout << “#” << n << " : " <<class_Assign (0, n, ‘a’) << endl;
}
return 0;
}

cout << “#” << n << " : "
Over here u don’t have to print n, u have to print test case number ie 1,2,3… like this in ascending order of test case

oh okay, the solution’s correct now. But can you tell me how to solve it using backtracking as this problem is mentioned in the backtracking challenge

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.