Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Any better chance to test column than chr(ord(...))? solution in Clear category for Pawn Brotherhood by new_hoschi
def safe_pawns(pawns: set) -> int:
return sum([(chr(ord(j[0])-1)+str(int(j[1])-1)) in pawns or (chr(ord(j[0])+1)+str(int(j[1])-1)) in pawns for j in pawns])
## for every pawn in the set: check whether there is another one in the lower (i.e. int j[1]-1) left (chr(ord(j[0]-1)1) or
## lower (see above) right (chr(ord(j[0]+1)) tile => current pawn is safe... sum up the safe pawns
March 27, 2020
Comments: