Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map<int, size_t> count;
- for(int i = 0; i < inputString.size(); i++) count[inputString[i]]++;
- for(auto &e:count) {
- if(e.first != 97+j) return false;
- j++;
- if(temp < e.second) return false;
- temp = e.second;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement