We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
vector<int>parseInts(stringstr){// Complete this functionvector<int>v;stringstr2="";for(inti=0;i<str.size();i++){if(str[i]==','){str2="";}else{str2=str2+str[i];}if(!str2.empty()&&(str[i+1]==','||str[i+1]=='\0'))v.push_back(stoi(str2));}returnv;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
StringStream
You are viewing a single comment's thread. Return to all comments →