I am using bottom up dp approach.
ways[0] = 1, ways[1] = 2;
then loop for I = 2 to 95 and make ways[I] = ways[I - 1] + ways[I - 2].
Why getting wrong ans? count Binary Strings
code :
using namespace std;
int main() {
int t; cin >> t;
int ways[95];
ways[0] = 1, ways[1] = 2;
for (int i = 2; i < 95; i++) {
ways[i] = ways[i - 1] + ways[i - 2];
}
while (t--) {
int n; cin >> n;
cout << ways[n] << "\n";
}
return 0;
}```