- Owner
- keegotp
- Problem
- Sequence
- Source
- 2.34KB
- Result
- Wrong answer
Compiler output
prog.cpp: In function 'std::vector<std::basic_string<char> > split(std::string, char)': prog.cpp:33:105: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] vector<string> split(string s, char sep){int prev_index = 0;int i = 0;vector<string> words;for(i = 0; i < s.size(); i++){if(s[i] == sep){words.push_back(s.substr(prev_index, i - prev_index));prev_index = i + 1;}}words.push_back(s.substr(prev_index, (s.size() - prev_index )));return words;} ^
Results
Test number Result Time 1 Ok 0.2734s 2 Ok 0.2773s 3 Ok 0.2759s 4 Ok 0.2735s 5 Wrong answer 0.2721s