Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Spaceship Landing Strip by UFO665
def square(lst, iRow, iCol):
iRes = iRowOffset = iMaxColOffset = 0
for row in lst[iRow:]:
iColOffset = 0
for char in row[iCol:]:
if char in "GS":
iColOffset += 1
else:
break
if not iMaxColOffset:
iMaxColOffset = iColOffset
if iColOffset:
if iColOffset < iMaxColOffset:
iMaxColOffset = iColOffset
iRowOffset += 1
else:
break
iCurRes = iRowOffset * iMaxColOffset
if iCurRes > iRes:
iRes = iCurRes
return iRes
def checkio(lst):
return max(square(lst, i, j) for j in range(len(lst[0])) for i in range(len(lst)))
Feb. 9, 2016