Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Territory of Go by BrianMcleod
def territory(board):
h = w = len(board)
valid = [(x,y) for x,row in enumerate(board) for y,c in enumerate(row) if c == '+']
out = {"W": 0, "B": 0}
def count_area(x,y):
if (x,y) not in valid:
if 0<=x
Oct. 17, 2018
Comments: