You are viewing a single comment's thread. Return to all comments →
My Python approach :
def solve(board): i = 0 if(board[0][1] == 0): check = 0 else: check = 1 if(len(board) % 2 == 0): while(i < len(board)): if board[i][i] != (1 - check) or board[i][len(board) - 1 - i] != check: return 'No' i += 1 else: while(i < len(board)): if board[i][i] != (1 - check) or board[i][len(board)-1-i] != (1 - check): return 'No' i += 1 i = 0 while(i < len(board)-1): if(board[i][i+1] != check or board[i+1][i] != check): return 'No' i += 1 return 'Yes'
Seems like cookies are disabled on this browser, please enable them to open this website
Customized Chess Board
You are viewing a single comment's thread. Return to all comments →
My Python approach :