Complete characterFrequency.js in O(n*log(n)) time complexity