Skip to content

Commit 117d3d7

Browse files
committed
Time: 1 ms (95.24%) | Memory: 45.4 MB (71.43%) - LeetSync
1 parent b314193 commit 117d3d7

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class Solution {
2+
public bool MakeEqual(string[] words) {
3+
int n = words.Length;
4+
int[] freq = new int[26];
5+
6+
foreach (var word in words){
7+
foreach (var c in word) {
8+
freq[c - 'a']++;
9+
}
10+
}
11+
12+
foreach (var count in freq) {
13+
if (count % n != 0) return false;
14+
}
15+
return true;
16+
}
17+
}

0 commit comments

Comments
 (0)