You are viewing a single comment's thread. Return to all comments →
int beautifulBinaryString(string b) { int count=0, idx; for(int i=0; i<b.size(); i++){ idx=b.find("010"); if(idx < b.size()){ b[idx+2]='1'; count++; } } return count; }
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 →