#include
using namespace std;
int main() {
int row,col,N;
cin>>N;
for(row=1;row<=2N-1;row++){
for (col=1;col<=row;col++){
if(row==1||row==2N-1){
cout<<"";
cout<<endl;
}
if(row==2||row==2N-2){
if(col==5){
cout<<’ ';}
else{
cout<<"*";
}
cout<<endl;
}
if(row==3||row==2*N-3){
if(col==4&&col==5&&col==6){
cout<<' ';}
else{
cout<<"*";}
cout<<endl;
}
if(row==4||row==2*N-4){
if(col==3&&col==4&&col==5&&col==6&&col==7){
cout<<' ';}
else{cout<<"*";
}
cout<<endl;
}
if(row==5||row==2*N-5){
if(col==2&&col==3&&col==4&&col==5&&col==6&&col==7){
cout<<' ';}
else{cout<<"*";}
cout<<endl;
}
}
}
}
link to the problem- https://online.codingblocks.com/app/player/246132/content/235743/4704/code-challenge