Pattern inverted hour glass


plz check whats wrong

your code will run only for n=5 in any other case it will not work

Modified Code

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved
if you have more doubts regarding this feel free to ask