leetcode419】的更多相关文章

Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may assume the following rules: You receive a valid board, made of only battleships or empty slots. Battles…
public class Solution { public int CountBattleships(char[,] board) { );//3行 );//4列 ; ; i < row; i++) { ; j < col; j++) { || board[i - , j] != || board[i, j - ] != 'X')) { count++; } } } return count; } } https://leetcode.com/problems/battleships-in-…