Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Ground for the House by _Chico_
def house(plan):
list_string = [l for l in plan.split('\n') if len(l) > 0]
lines_index = []
hash_index = []
height, width = 0, 0
for i in range(len(list_string)):
if "#" in list_string[i]:
lines_index.append(i)
hash_index.append(list_string[i].find("#"))
hash_index.append(list_string[i].rfind("#"))
height = max(lines_index) - min(lines_index) +1
width = max(hash_index) -min(hash_index) +1
return height*width
Aug. 23, 2021