public void solve(char[][] board) {
		
		int x=board.length;
        if(x==0)    return;
        int y =board[0].length;
        if(x==1&&y==1)  return;
        boolean[][] visited = new boolean[x][y];
        for(int i =0; i< x;i++)
        {
            for(int j =0;j<y;j++)
            {
                if(board[i][j]=='O')
                {
                	clearvisited(visited);
                    if(check(board,i,j,visited))
                    {
                        fill(board,i,j);
                    }
                }
            }
        }
    }