Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Pawn Brotherhood by plutasnyy
def safe_pawns(pawns):
pawns_indexes = set()
for i in pawns:
a = int(i[1])-1
b = ord(i[0])-97
pawns_indexes.add((a, b))
licznik = 0
for i, j in pawns_indexes:
if ((i-1, j-1) in pawns_indexes) or ((i-1, j+1) in pawns_indexes):
licznik = licznik+1
return licznik
Oct. 30, 2016
Comments: