Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Strip empty, len * len solution in Clear category for Ground for the House by Olpag
def house(plan):
mas = plan.strip().split('\n')
k = 0
while mas:
if mas[0].isdigit():
mas.remove(mas[0])
elif mas[-1].isdigit():
mas.remove(mas[-1])
elif k == 0 :
mas = [''.join(list(_)) for _ in zip(*mas)]
k = 1
else:
break
return len(mas) * len(mas[0]) if mas else 0
March 27, 2019
Comments: