DEV Community

Discussion on: Daily Challenge #244 - Search for Letters

Collapse
 
vidit1999 profile image
Vidit Sarkar • Edited

Here is a C++ solution,

string change(string s){
    string st(26, '0');

    for(char c : s)
        if(islower(c) || isupper(c))
            st[tolower(c)-'a'] = '1';

    return st;
}