Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
bytes and filter solution in Clear category for Pawn Brotherhood by pherapont
def safe_pawns(pawns):
def func(pos):
a = list(bytes(pos,"cp1251"))
safer_1 = str(bytes([a[0]-1,a[1]-1]),"cp1251")
safer_2 = str(bytes([a[0]+1,a[1]-1]),"cp1251")
return safer_1 in pawns or safer_2 in pawns
return len(list(filter(func,pawns)))
June 4, 2019