When we see a ‘1’ , do a BFS or DFS to visit the whole ‘island’
mark cells as ‘-1’ once we’ve seen it
increment the number of islands we’ve seen once the whole island is
visited isValidPosition(int x, int y) // possible moves from a current cell
static int[] dx = {-1,0,0,1};
static int[] dy = {0,1,-1,0};