I have the following code that checks the value of each key in an unordered_map called char_count, and returns false if we find a value that is not equal to zero:
Unfortunately this gives the following error: no match for'operator[]' (operand types are 'std::unordered_map<char, int>' and 'std::pair<const char, int>').
I've also tried the following:
1 2 3 4
for(int i = 0; i < char_count.size(); i++){
if(char_count->second != 0){
returnfalse;
}
but get the follwing error: base operand of '->' has non-pointer type 'std::unordered_map<char, int>'