Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
enumerate solution in Clear category for Ground for the House by David_Jones
def house(plan):
U, D, L, R = 10, -1, 10, -1
for i, row in enumerate(plan.strip().splitlines()):
for j, ch in enumerate(row):
if ch == '#':
U, D, L, R = min(U, i), max(D, i), min(L, j), max(R, j)
return max(0, D - U + 1) * max(0, R - L + 1)
May 4, 2019
Comments: