Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by watti
def safe_pawns(pawns):
safe = []
for pawn in pawns:
if not (pawn in safe):
possible1 = chr(ord(pawn[0]) - 1) + str(int(pawn[1]) - 1)
possible2 = chr(ord(pawn[0]) + 1) + str(int(pawn[1]) - 1)
if (possible1 in pawns) or (possible2 in pawns):
safe.append(pawn)
return len(safe)
Dec. 21, 2015