algorithms/strings/string-construction.c
int stringConstruction(char* s) {
    int m[256];
    memset(m, 0, sizeof(m));
    for (int i = 0; s[i]; i++) {
        m[s[i]] = 1;
    }
    int cost = 0;
    for (int i = 0; i < 256; i++) {
        cost += m[i];
    }
    return cost;
}
// Complete the stringConstruction function below.
Complete the stringConstruction function below.
Complete the stringConstruction function below .
int stringConstruction(char* s) {
    int m[256];
    memset(m, 0, sizeof(m));
    for (int i = 0; s[i]; i++) {
        m[s[i]] = 1;
    }
    int cost = 0;
    for (int i = 0; i < 256; i++) {
        cost += m[i];
    }
    return cost;
}
int stringConstruction ( char * s ) { int m [ 256 ] ; memset ( m , 0 , sizeof ( m ) ) ; for ( int i = 0 ; s [ i ] ; i ++ ) { m [ s [ i ] ] = 1 ; } int cost = 0 ; for ( int i = 0 ; i < 256 ; i ++ ) { cost += m [ i ] ; } return cost ; }
Complete the stringConstruction function below.
Complete the stringConstruction function below .