You are viewing a single comment's thread. Return to all comments →
C++ solution:
int marsExploration(string s) { int i; int size_s = s.size(); string sub; int count = 0;
for (i=0; i<size_s; i= i+3) { sub = s.substr(i, 3); if (s[i] != 'S'){ count++; } if (s[i+1] != 'O'){ count++; } if (s[i+2] != 'S'){ count++; } // cout << "alo: " << sub << endl; // cout << "count: " << count << endl; } return count;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
C++ solution:
int marsExploration(string s) { int i; int size_s = s.size(); string sub; int count = 0;
}