Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Ground for the House by Moff
function house(plan) {
let rows = new Set();
let cols = new Set();
plan.split('\n').forEach((row, i) => {
row.split('').forEach((c, j) => {
if (c == '#') {
rows.add(i);
cols.add(j);
}
});
});
return rows.size ? (Math.max(...rows) - Math.min(...rows) + 1) * (Math.max(...cols) - Math.min(...cols) + 1) : 0;
}
Oct. 4, 2018
Comments: