Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Ground for the House by Moff
def house(plan):
rows = set()
cols = set()
for i, row in enumerate(plan.splitlines()):
for j, cell in enumerate(row):
if cell == '#':
rows.add(i)
cols.add(j)
return (max(rows) - min(rows) + 1) * (max(cols) - min(cols) + 1) if rows else 0
Sept. 23, 2018
Comments: