In this question, I was unable to solve it so saw the solution. But in the solution, we took number of stars(nsp) which is number of stars in the very first line of the pattern as (n/2)+1.
so suppose n=5, then nsp=(5/2)+1 which will give nsp as 3.
But the number of stars in the very first line of the pattern is 5
Unable to understand the solution
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.