When did the stars become Zero

i did not understand where did the stars become zero and then start incrementing.

Hi Nipun

If you observe the pattern carefully, you’ll see that if the value of n = 7, then the no. of stars are decrementing for the first half and then incrementing in the second half. That is why at the end of each iteration, during the preparation stage, if the row we are currently in is less than or equal to n/2, we decrement the stars and increment otherwise.

Hey Nipun,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.