My code not being considered correct

why is my code not being considered correct

hi @kartikstackexchange_77770317975ae8b4

for(int d=1;d<=n-i;d++){
     cout<<" ";
} 

here run a loop till n-i and not n-i-1
rest ur logic was absolutely correct, just small modification in printing format…
corrected code --> https://ide.codingblocks.com/s/642837
its passing all test cases now…

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.