Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by iurii.skorniakov
def safe_pawns(pawns):
tab = dict(zip("abcdefgh", "12345678"))
pawns = list(map(lambda x:(int(tab[x[0]]), int(x[1])), pawns))
count = 0
for x, y in pawns:
if (x-1, y-1) in pawns or (x+1, y-1) in pawns:
count += 1
return count
Aug. 15, 2017