赞
踩
def func(board): res = 0 m, n = len(board), len(board[0]) for i in range(m): for j in range(n): if board[i][j] == '.': continue if i > 0 and board[i-1][j] == 'X': continue if j > 0 and board[i][j-1] == 'X': continue res += 1 return res print(func(board=[["X","X","X"]]))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。