Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by tmaeda11235
def safe_pawns(pawns):
safe_area = set()
for pawn in pawns:
col, row = map(ord, pawn)
safe_area |= {"".join(map(chr, (col + 1, row + 1)))}
safe_area |= {"".join(map(chr, (col - 1, row + 1)))}
return len(safe_area & pawns)
Aug. 12, 2017