You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution
int marsExploration(string s) { int sz = s.size(); string strSos("SOS");
int no_sos = sz/ 3; for(int i = 0; i < no_sos-1; i++) strSos.append("SOS"); int cnt = 0; for( int i = 0; i < sz; i++) { if( strSos[i] != s[i] ) cnt++; } return cnt;
}
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 →
Here is my c++ solution
int marsExploration(string s) { int sz = s.size(); string strSos("SOS");
}