below is my code i am getting my output right but it kept failing two test cases .
#include
using namespace std;
int main()
{
int N,row,col;
cin>>N;
for(row=1;row<=N;row++)
{
for(col=1;col<=(N-row);col++)
{
cout<<" "<<" ";
}
for(col=1;col<=((2*row)-1);col++)
{
if(row>1)
{
cout<<1<<" ";
for(col=1;col<=((2*row)-3);col++)
{
if(col%2==0)
{
cout<<row-1<<" ";
}
else
{
cout<<" "<<" ";
}
}
}
cout<<1<<" ";
break;
}
cout<<endl;
}
return 0;
}
please help me to solve this problem
thanking you in advance