Explained step by step :::: Using frequency count in Java (Easy)
Intuition\n Describe your first thoughts on how to solve this problem. \nThe count of characters should be divisble by the length of String array.\n\n# Approach
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe count of characters should be divisble by the length of String array.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nCondition 1 : If length of the array is less than or equal to one. return true.\n\nCondition 2 : If number of characters should be divisble by the length of the String Array. \n\nCondition 3 : The each charaters frequency should be divisble by the length of the String Array. \n\nAll test conditions are passed reture true.\n\nLet testcase be ["abc", "aabc", "bc"] expected true.\nTake the length as count // 3\nThe charactersCount is 9\n\nNow, take a characterMap of 26(a - z) calculate the frequency of each character. \n[3, 3, 3, 0, 0, 0...] cause we have only 3 character and each character frequency is 3.\n\nIterator through the characterMap and check if frequency is divisble by count. If not return false.\n\nAll test conditions passed return true. \n# Complexity\n- Time complexity: O(N ^ 2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\n```\nclass Solution {\n    public boolean makeEqual(String[] words) {\n        int count = words.length;\n        if (count <= 1) return true;\n\n        int charactersCount = getCharactersCount(words);\n        if (charactersCount % count != 0) return false;\n\n        int[] characterMap = new int[26];\n\n        for (String word : words)\n        {\n            for (int i = 0; i < word.length(); i++)\n            {\n                int index = word.charAt(i) - \'a\';\n                characterMap[index]++;\n            }\n        }\n\n        for (int i = 0; i < 26; i++)\n        {\n            int value = characterMap[i];\n            if (value != 0)\n            {\n                if (value % count != 0)\n                {\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n\n    private int getCharactersCount(String[] words)\n    {\n        int counter = 0;\n        for (String word : words)\n        {\n            counter += word.length();\n        }\n\n        return counter;\n    }\n}\n```\n\n![UpVote.jpg](https://assets.leetcode.com/users/images/f23364ec-2b6d-42d3-b34c-e8a5ca87efd6_1703919654.7285311.jpeg)\nThank you.\n\n
['Java']