Hello Jesvant Somepalli,
I would highly recommend that you should watch the walkthrough again, if you have watched already, while taking notes. Use a pen and a paper first to draw the pyramid, while working in your head, how on this planet earth, you would try to instruct the computer to do the same. Nevertheless, I will try to the best of my ability to explain to you on how to go about this problem.
As per the requirement, we want to start off by printing 2 # on the top most row, and keep on increasing 1 # as we move down the height(y-axis). So how will we print the the first row, given that we want to print h height half-pyramid? (If you take a careful look, you will notice that if the height is h then the width would be h+1, lets assign the width its own letter, w). So the very first line would be printed as follows:
print a space w-2 times;
print # 2 times;
print a new line; //to go to the next row
You would notice that for each space and for each # to be printed on each row, you would need a loop, because a space-character would keep on decreasing in number and a # character would keep on increasing as you move down the height(y-axis). So the above code will only and ONLY get printed ONCE, for it to be printed h times we need it to copy and paste it h times. Of-course that would be foolish of us, knowing that we now have the loops in our spell-book.
Woah! that was alot, I don't have a habit to speak alot :p. Anyways, if you find this confusing, then please try to read it again while taking notes, and InshaAllah (if Allah wills) you will find it easy to comprehend.
Hope this helps!