You are viewing a single comment's thread. Return to all comments →
int beautifulBinaryString(string b) { int ptrn = 0; for (int i = 0; i<b.size(); i++){ string sub = b.substr(i, 3); if(sub=="010"){ ptrn++; i+=2; } } return ptrn; }
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Binary String
You are viewing a single comment's thread. Return to all comments →