Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by MichalMarsalek
def safe_pawns(pawns):
c = 0
brother = lambda pawn, d: chr(ord(pawn[0])+d) + str(int(pawn[1])-1)
for pawn in pawns:
c += brother(pawn, -1) in pawns or brother(pawn, 1) in pawns
return c
Aug. 16, 2015