algorithms/strings/beautiful-binary-string.c
int beautifulBinaryString(char* b) {
    int changes = 0;
    
    for (;;) {
        char *p = strstr(b, "010");
        if (p) {
            if (p[3] == '1') {
                p[2] = '1';
            } else {
                p[1] = '0';
            }
            changes++;
        } else {
            break;
        }        
    }
    
    return changes;

}
// Complete the beautifulBinaryString function below.
Complete the beautifulBinaryString function below.
Complete the beautifulBinaryString function below .
int beautifulBinaryString(char* b) {
    int changes = 0;
    for (;;) {
        char *p = strstr(b, "010");
        if (p) {
            if (p[3] == '1') {
                p[2] = '1';
            } else {
                p[1] = '0';
            }
            changes++;
        } else {
            break;
        }        
    }
    return changes;
}
int beautifulBinaryString ( char * b ) { int changes = 0 ; for ( ; ; ) { char * p = strstr ( b , " " ) ; if ( p ) { if ( p [ 3 ] == ' ' ) { p [ 2 ] = ' ' ; } else { p [ 1 ] = ' ' ; } changes ++ ; } else { break ; } } return changes ; }
Complete the beautifulBinaryString function below.
Complete the beautifulBinaryString function below .