Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Straightforward solution in Clear category for [old] The Most Wanted Letter by nickie
"use strict";
function mostWanted(data) {
let C = {'a': 0}, winner = 'a';
for (let x of data.toLowerCase())
if (x.match(/[a-z]/)) {
if (x in C) C[x]++; else C[x] = 1;
if (C[x] > C[winner] || C[x] == C[winner] && x < winner) winner = x;
}
return winner;
}
Sept. 12, 2016
Comments: