Check out example codes for "finding no of unique characters in a string c++". It will help you in understanding the concepts better.

Code Example 1

int countDistinct(string s) 
{ 

    unordered_map<char, int> m; 

    for (int i = 0; i < s.length(); i++) { 
        m[s[i]]++; 
    } 

    return m.size(); 
}

Learn ReactJs, React Native from akashmittal.com