private static void dfs(char[][] s, int x, int y) {
        if(s[x][y] != 'O') {
            return;
        }

        s[x][y] = 'Y';

        if(x-1 >= 0 && s[x-1][y] == 'O') {
            dfs(s,x-1,y);
        }

        if(x+1 < s.length  && s[x+1][y] == 'O') {
            dfs(s,x+1,y);
        }

        if(y-1 >= 0 && s[x][y-1] == 'O') {
            dfs(s,x,y-1);
        }

        if(y+1 < s[0].length && s[x][y+1] == 'O') {
            dfs(s,x,y+1);
        }

    }