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 MBM_1607
def house(plan):
if "#" not in plan: return 0
def coords():
for i, row in enumerate(plan.splitlines()):
for j, cell in enumerate(row):
if cell == "#":
yield i, j
rows, cols = zip(*coords())
length = lambda lst: max(lst) - min(lst) + 1
return length(rows) * length(cols)
Sept. 5, 2018