Here is my code :
Its showing wrong ans.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int pairFriends(int n) {
if(n == 0 || n == 1) {
return 1;
}
return pairFriends(n - 1) + (n - 1) * pairFriends(n-2);
}
int main()
{
int t; cin >> t;
while(t–) {
int n; cin >> n;
cout << pairFriends(n) << endl;
}
return 0;
}