Beautiful Binary String

  • + 0 comments

    here is my C solution: int c=0,i=0; int beautifulBinaryString(char* b) { if(b[i]!='\0') { if(b[i]=='0' && b[i+1]=='1' && b[i+2]=='0') { c++; i=i+3; } else{i++;} beautifulBinaryString(b); } return c; } *