Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
8-liner: min of min indexes and max of max indexes solution in Creative category for Ground for the House by Stensen
from re import split
def house(plan):
if '#' not in plan: return 0
widths = []
for hashtag in filter(None, split('\n', plan)):
if '#' in hashtag: widths.extend([hashtag.index('#'), hashtag.rindex('#')])
heights = {i for i, hashtag in enumerate(filter(None, split('\n', plan))) if '#' in hashtag}
return (max(widths) - min(widths) + 1) * (max(heights) - min(heights) + 1)
Nov. 23, 2020