Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by magda_kudrycka
def safe_pawns(pawns):
licznik = 0
indeksy = set()
for p in pawns:
rzad = int(p[1]) - 1
col = ord(p[0]) - 97
indeksy.add((rzad, col))
for rzad, col in indeksy:
bezp = any(((rzad - 1, col - 1) in indeksy, (rzad - 1, col + 1) in indeksy))
if bezp:
licznik += 1
return licznik
Nov. 27, 2016