<awangdev>200. Number of Islands_2.java
private int countIsland(char[][] grid) {

        int m = grid.length, n = grid[0].length;
        int count = 0;
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                count += grid[i][j] == '1' ? 1 : 0;
            }    
        }
        return count;
    }
private int sample_funcname ( char [ ] [ ] var_0 ) {
  int var_2 = var_0 . length , var_4 = var_0 [ 0 ] . length ;
  int var_5 = 0 ;
  for ( int var_6 = 0 ;
  var_6 < var_2 ;
  var_6 ++ ) {
    for ( int var_7 = 0 ;
    var_7 < var_4 ;
    var_7 ++ ) {
      var_5 += var_0 [ var_6 ] [ var_7 ] == '1' ? 1 : 0 ;
    }
  }
  return var_5 ;
}
