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 RomanTT
def house(plan):
if '#' not in plan:
return 0
print(plan)
top,left,right,down,row = -1,10,0,0,0
for i in plan.split():
al = i.find('#')
ar = i.rfind('#')
if al!=-1 and top==-1:
top = row
if al!=-1 and alright:
right = ar
if ar!=-1:
down = row
row+=1
return (right-left+1)*(down-top+1)
Oct. 11, 2018