Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] The Most Wanted Letter by Moff
function mostWanted(data) {
let ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz';
let counter = {};
for (let c of data.toLowerCase()) {
if (ascii_lowercase.indexOf(c) > -1)
counter[c] = counter[c] + 1 || 1;
}
let result = '', count = 0;
for (let c in counter) {
if ((counter[c] > count) || (counter[c] === count && c < result)) {
result = c;
count = counter[c];
}
}
return result;
}
July 5, 2017