Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by mlahor
def safe_pawns(pawns: set) -> int:
safe_no=0
for pawn in pawns:
p1=chr(ord(pawn[0])-1)+str(int(pawn[1])-1)
p2=chr(ord(pawn[0])+1)+str(int(pawn[1])-1)
safe_no += p1 in pawns or p2 in pawns
return safe_no
Oct. 28, 2019
Comments: