Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
functional, minimized while still readable solution in Creative category for Pawn Brotherhood by juestr
def safe_pawns(pawns: set) -> int:
plocs = [(ord(p[0]), ord(p[1])) for p in pawns]
def issafe(l):
x, y = l
return (x+1, y-1) in plocs or (x-1, y-1) in plocs
return sum(map(issafe, plocs))
April 12, 2019
Comments: