Hollow diamond

I am trying to code hollow diamond pattern but it is giving aborting command wall time warning and not showing output.
However, when i run same code on vs code, there is no problem. Would you explain me the reason and also send me the optimised code for it.

hi @discobot,
please check -->

Hi! To find out what I can do, say @discobot display help.

#include using namespace std; int main() { unsigned int n; cin>>n; int row, col,i=0; for(row=1;row<2n;row=row+1){ for(col=1;col<2n;col=col+1){ if(col<=n-i||col>=n+i){ cout<<’*’; } else{ cout<<’ '; } } if(row<n){ i=i+1; } else{ i=i-1; } cout<<endl; } cout<<endl; return 0; }

Please suggest some optimisation to this code

hi @discobot send the code on ide.codingblock.com
write
save
send the url of page

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

sir when i clicked on share option i didn’t get the url please tell me how can i send you a pdf file

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

sir when i clicked on share option i didn’t get the url please tell me how can i send you a pdf file

@discobot
Write save and send the url by copy pasting

Hi! To find out what I can do, say @discobot display help.

hi @discobot submit your code its passing all test cases

Hi! To find out what I can do, say @discobot display help.