Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
short and easy solution in Clear category for Pawn Brotherhood by pawelek.miecz
def safe_pawns(pawns: set) -> int:
moves=set()
for p in pawns:
moves.add(chr(ord(p[0])+1)+str(int(p[1])+1))
moves.add(chr(ord(p[0])-1)+str(int(p[1]) + 1))
return sum(1 for p in pawns if p in moves)
Oct. 12, 2018