Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Generation X (and Y) solution in Clear category for Ground for the House by veky
def house(plan):
def coords():
for i, row in enumerate(plan.splitlines()):
for j, cell in enumerate(row):
if cell == '#': yield i, j
def span(range): return max(range) - min(range) + 1
try: rows, cols = zip(*coords())
except ValueError: return 0
else: return span(rows) * span(cols)
Sept. 3, 2018
Comments: