Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by a691662
# migrated from python 2.7
def safe_pawns(pawns):
count = 0
for pawn in pawns:
col, row = list(map(ord, list(pawn)))
SW_pawn = ''.join(map(chr, [col-1, row-1]))
SE_pawn = ''.join(map(chr, [col+1, row-1]))
if SW_pawn in pawns or SE_pawn in pawns:
count += 1
return count
Feb. 6, 2015
Comments: