Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by JamesNippoc
def safe_pawns(pawns):
m,s = [[False for _ in range(10)] for _ in range(8)],0
for c in pawns:
m[int(c[1])-1][ord(c[0])-96] = True
for i in range(1,8):
for j in range(1,9):
if m[i][j] and (m[i-1][j-1] or m[i-1][j+1]): s+=1
return s
Dec. 2, 2014