Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Using 'xabcdefghx' where x delimit the extremities solution in Clear category for Pawn Brotherhood by jiizzyy
def safe_pawns(pawns: set) -> int:
protected, colums = 0, 'xabcdefghx'
for pawn in pawns:
c,r = colums.index(pawn[0]), int(pawn[1])
if colums[c-1]+str(r-1) in pawns or colums[c+1]+str(r-1) in pawns:
protected += 1
return protected
Feb. 7, 2020