Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
strip and split with \n, zip(*rows) solution in Clear category for Ground for the House by Phil15
def house(plan):
def length(L):
M = [i for i, row in enumerate(L) if '#' in row]
return max(M) - min(M) + 1 if M else 0
rows = plan.strip('\n').split('\n')
cols = zip(*rows)
return length(rows) * length(cols)
Sept. 4, 2018
Comments: