Leetcode_1020_飞地的数量_dfs

朴实无华的深搜
class Solution {
int n;
int m;
int ans;
boolean[][] vis;
int[][] grid;
int[][] direction = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};

public int numEnclaves(int[][] grid) {
n = grid.length;
m = grid[0].length;
ans = 0;
vis = new boolean[n][m];
this.grid = grid;
for(int i = 0;i < n;i++) { for(int j = 0;j < m;j++) {

Leetcode_1020_飞地的数量_dfs最先出现在Python成神之路

版权声明:
作者:zhangchen
链接:https://www.techfm.club/p/18892.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>