Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Pawn Brotherhood by mozurin
"use strict";
function safePawns(data)
{
const safeHash = {};
return data.map(
p => {
const coord = [p.charCodeAt() - 96, parseInt(p[1])];
[-1, +1].forEach(d => safeHash[[coord[0] + d, coord[1] + 1]] = 1);
return coord;
}
).reduce((s, e) => s + !!safeHash[e], 0);
}
June 18, 2018