My issue
Hey this code I wrote works perfectly in my code editor but when I try to run here, it states runtime error
My code
#include<iostream>
#include<vector>
std::vector<int> results;
int findMissingdoll(){
int n, miss = 0;
std::vector<int> inputs;
std::cin >> n;
for (int i = 0; i < n; i++)
{
int a;
std::cin >> a;
inputs.push_back(a);
}
for(const auto& n : inputs){
if(n % 2 != 0){
miss++;
}
}
results.push_back(miss);
}
int main(){
int b;
std::cin >> b;
for (int i = 0; i < b; i++)
{
findMissingdoll();
}
for(const auto& n : results)
std::cout << n << '\n';
}
Learning course: Arrays, Strings & Sorting
Problem Link: Chef and Dolls Practice Problem in - CodeChef