Related to hollow diamond pattern 6

this code only works for n=5 not 7 ,9;upper part is solved it is dhowing problem in lower part in spaces .plz guide me related to this. and i always face problem in spces of lower part when they are dreasing plz suggest some tricks.
my code

@avverma11057 you shared the wrong code

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.