Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Pawn Brotherhood by Pactp
def safe_pawns(pawns: set) -> int:
s = "_abcdefgh_"
return sum(( 1 for p in pawns
if s[s.index(p[0])-1]+str(int(p[1])-1) in pawns
or s[s.index(p[0])+1]+str(int(p[1])-1) in pawns))
May 2, 2023