in the else part 0s display till the second last number so why do we have to use row -2 instead of row-1
Loop related problem
Please watch the video again.
For a row say i:
There will be i elements in that row. The boundary elements will be 1. The elements in between will be 0. So you can say there are i-2 0s. Because of this row-2 is used. It represents the count of 0s and not its index.
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.