Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No If solution in Clear category for [old] The Most Wanted Letter by juacompe
"use strict";
function mostWanted(str) {
var bag, maxCount, keys;
bag = {};
str.toLowerCase().replace(/[^a-z]/g, '').split('').map((x) => {
if(bag[x])
bag[x]++;
else
bag[x] = 1;
});
keys = Object.keys(bag);
maxCount = keys.reduce((m, x) => Math.max(bag[x], m), 0);
return keys.sort().find((key) => bag[key] == maxCount);
}
Dec. 14, 2016
Comments: