Skip to content

Commit a646075

Browse files
authored
Create Problem 1897.cpp
1 parent 679ab79 commit a646075

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Problem 1897.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Solution {
2+
public:
3+
bool makeEqual(vector<string>& words) {
4+
vector<int> chcount(26,0);
5+
for(const string& word:words) {
6+
for(char c:word) {
7+
chcount[c-'a']++;
8+
}
9+
}
10+
for(int count:chcount) {
11+
if(count%words.size()!=0) {
12+
return false;
13+
}
14+
}
15+
return true;
16+
}
17+
};

0 commit comments

Comments
 (0)