Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- bool makeEqual(vector<string>& words) {
- int ch[26];
- memset(ch, 0, sizeof ch);
- for(auto word: words){
- for(char c: word){
- ch[c-'a']++;
- }
- }
- int n = words.size();
- for(int i=0; i<26; i++)
- if(ch[i]%n)
- return false;
- return true;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement