comefrom: <doocs>0419.Battleships in a Board_1.py
code: def countBattleships( board: List[List[str]]) -> int:
      m, n = len(board), len(board[0])
      ans = 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
              ans += 1
      return ans
masked: def sample_funcname ( var_0 : List [ List [ str ] ] ) -> int :
      var_1 , var_2 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_3 = 0
      for var_4 in range ( var_1 ) :
          for var_5 in range ( var_2 ) :
              if var_0 [ var_4 ] [ var_5 ] == '.' :
                  continue
              if var_4 > 0 and var_0 [ var_4 - 1 ] [ var_5 ] == 'X' :
                  continue
              if var_5 > 0 and var_0 [ var_4 ] [ var_5 - 1 ] == 'X' :
                  continue
              var_3 += 1
      return var_3
  