MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / count

Method count

java/1020-number-of-enclaves.java:11–21  ·  view source on GitHub ↗
(int [][]board)

Source from the content-addressed store, hash-verified

9
10class Solution {
11 public int count(int [][]board){
12 int c = 0;
13 for(int i=0; i<board.length; i++){
14 for(int j=0; j<board[0].length; j++){
15 if(board[i][j] == 1){
16 c++;
17 }
18 }
19 }
20 return c;
21 }
22 public void dfs(int r, int c, int[][] board){
23 if(r<0 || c<0 || r>board.length-1 || c>board[0].length-1 || board[r][c] != 1) return;
24

Callers 2

numEnclavesMethod · 0.95
findMaxFormMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected