Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Convert into numerical co-ordinates, then compare by 9 & 11 solution in Clear category for Pawn Brotherhood by Fermax
def convert(s):
# Convert into numerical co-ordinates, eg a1=11, b3=23
return (ord(s[1])-48)*10 + (ord(s[0])-96)
def safe_pawns(pawns):
# Convert into set into co-ordinates
coords = set([convert(p) for p in pawns])
# Count the number of pawns protected
return len([p for p in coords if {p-9,p-11} & coords])
Jan. 3, 2017
Comments: