DOUBT IN MIRROR PATTERN

QUES:
https://hack.codingblocks.com/app/contests/1936/192/problem
CODE:

hello @aaliyah_beg

the logic is not correct.
split each row into two section.
first print some spaces and then some stars.

the formula that u r using to determing no spaces and stars is also not correct.

if i <=n/2 then spaces will i-1 and stars will be 2*i-1

Sir, the logic works. If we simple initialise i and a outside before their for loop respectively im not getting any error and its working fine CODE:https://ide.codingblocks.com/s/376698

ok , i tried running ur last code , it was giving some weird result that why i said it is wrong

Well i had by mistake written j+=2 instead of j++ so might be thats why.

yeah may be, r u still facing any issue in this?

No sir, I got it .Thank you!