Why test cases failing?

Question : https://online.codingblocks.com/app/player/213153/content/213766/5325/code-challenge

My Solution : https://ide.codingblocks.com/s/653223

Why test cases failing ??

Hey @mail2aqibahmed_23714997a14745bb The first loop which brings spaces at the begging is giving 1 space even for row one and from second row onwards it is giving 2 spaces, 3 spaces etc.
But the sequence should be 0 spaces,1spaces,2spaces etc.

@pssharma1410 got it thanks!

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.