Java | String | Frequency Count | Array
Java | String | Frequency Count | ArrayApproach: In CommentsCode
# Java | String | Frequency Count | Array
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach: In Comments
<!-- Describe your approach to solving the problem. -->


# Code
```java []
class Solution {
    public boolean makeEqual(String[] words) {
        int[] freq= new int[26]; // making array of integer to store the frequency of each character in the string

        for(int i=0; i<words.length;i++){
            String w=words[i]; // storing each word in words string array into a variable w

            for(int j=0; j<w.length();j++){ //traversing the w string
                char ch=w.charAt(j);  // Putting each character of the string in the ch variable
                int idx= (int)(ch-'a'); // calculating the index of the each character

                freq[idx]=freq[idx]+1; // updating the freuency index for the each character occurence
            }
        }
        for(int i=0;i<26;i++){ // traversing on frquency array
            if(freq[i]% words.length !=0){ // checking if the each index updated in freq array is gives the reaminder zero if not then return false
                return false;
            }
        }
        return true; // else retrun true
    }
}
```
['String', 'Counting', 'Java']