Here is code link geting one extra star in 1st and last row where i am doing mistake

Hey @Rohan-Duggal-1255727097955490,
You need to start the space from -1 and not 0 as the 2nd row has a space of 1 and there’s a difference of 2 from next row onwards.
Secondly, you need to add a separate condition for row 1 and row n while printing the stars to avoid the printing of extra star.

Here’s your updated code.

Hope it helps :slight_smile:

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.