You are viewing a single comment's thread. Return to all comments →
c++
int beautifulBinaryString(string b) { int val =0; int n = b.size(); for (int i=2; i< n; i++) { if (b.at(i) == '0' and b.at(i-2)=='0' and b.at(i-1)=='1') { b.at(i) = '1'; val++; } } return val; }
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 →
c++