Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Third: brute force with incremental testing solution in Clear category for Spaceship Landing Strip by juestr
def checkio(area: list[str]) -> int:
area = [[c in 'GS' for c in row] for row in area]
width = len(area[0])
height = len(area)
max_rect = 0
for x0 in range(width):
if (width - x0) * height <= max_rect:
break
for y0 in range(height):
for x1 in range(x0, width):
if not area[y0][x1]:
break
for y1 in range(y0, height):
if not all(area[y1][x0:x1+1]):
break
max_rect = max(max_rect, (x1 - x0 + 1) * (y1 - y0 + 1))
return max_rect
April 3, 2021