get vector input from string in c++
vector<int> getVectorInput(string s){
string res="";
vector<int> arr;
for(auto e : s){
if(e==' '){
if(res.size()!=0)
arr.push_back(stoi(res));
res="";
continue;
}
res+=e;
}
if(res.size()!=0)
arr.push_back(stoi(res));
return arr;
}