Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
xs, ys = zip(*grounds) solution in Clear category for Ground for the House by flpo
def house(plan):
grounds = [(i, j) for i, row in enumerate(plan.split()) for j, cell in enumerate(row) if cell == '#']
if not grounds:
return 0
xs, ys = zip(*grounds)
return (xs[-1] - xs[0] + 1) * (max(ys) - min(ys) + 1)
Sept. 3, 2018
Comments: