Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
chr( ord ( ) ) solution in Clear category for Pawn Brotherhood by kim.yangjin
def safe_pawns(pawns: set) -> int:
def guard12(pa):
guard1 = chr(ord(pa[0])-1)+str(int(pa[1])-1)
guard2 = chr(ord(pa[0])+1)+str(int(pa[1])-1)
return (guard1 in pawns or guard2 in pawns)
return sum(guard12(i) for i in list(pawns))
Aug. 10, 2020
Comments: