海洋中岛屿数量问题 算法 DFS
const getIslands = (arr = []) => {
const len = arr.length;
const counter = 0;
while(len) {
let row = arr[arr.length - len];
// let item;
let num = 0;
let cur = 0;
for (let i = 0; i < row.length; i++) {
let item = row[i];
if(item === `+`) {
num +=1;
let netxItem = row[i + 1];
// const nextRow = arr[arr.length - len + 1];
// let nextRowitem = nextRow[i];
if(item === netxItem) {
break;
}
}
}
}
}