It shows warning comparsion between pointer and integer type.I don't know where the problem is.Help me


  • 0
    D
    void solve(char** board, int boardRowSize, int boardColSize) {
    int i,j,k,l;
    for(i=0;i<=boardRowSize-1;i=i+boardRowSize-1)
    {
    for(j=0;j<=boardColSize-1;j++)
    {
        k=i;l=j;
        while((board[k][l]=='o')&&i==0&&k!=boardRowSize)
        {
           board[k][l]='1';
           k++;
        }
        while((board[k][l]=='o')&&i==boardRowSize-1&&k!=-1)
        {
            board[k][l]='1';
            k--;
        }
    }
       if(boardRowSize!=2)
    {
    for(i=1;i<=boardRowSize-2;i++)
    {
    for(j=0;j<=boardColSize-1;j=j+boardColSize-1)
    {
        k=i;l=j;
        while(board[k][l]=='o'&&j==0&&l!=boardColSize)
        {
           board[k][l]='1';
           l++;
        }
        while(board[k][l]=='o'&&j==boardColSize-1&&l!=0)
        {
            board[k][l]='1';
            l--;
        }
    }
    }
    }
    for(i=0;i<=boardRowSize-1;i++)
    {
        for(j=0;j<=boardColSize-1;j++)
        {
            if(board[i][j]=='o'&&board[i-1][j]!='1'&&board[i+1]!='1'&&board[i][j-1]!='1'&&board[i][j+1]!='1')
            {
                board[i][j]='x';
                continue;
            }
            board[i][j]='1';
        }
    }
    for(i=0;i<=boardRowSize-1;i++)
    {
        for(j=0;j<=boardColSize-1;j++)
        {
            if(board[i][j]=='1')
            {
                board[i][j]='o';
                
            }
            
        }
    }
    

    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.