문제 링크 : Check if All Characters Have Equal Number of Occurrences
/**
* @param {string} s
* @return {boolean}
*/
var areOccurrencesEqual = function(s) {
const arr = new Array(26).fill(0)
for(let el of s ) {
arr[el.charCodeAt()-97] += 1
}
const sSet = new Set(arr)
return sSet.has(0) ? sSet.size ===2 : sSet.size === 1
};