So, not exactly:

First:

You deal with spaces (replace them by * until you 're sure it works, it's easier to see the result that way) first, alone, **then** you deal with sharps, alone. For each row.

Pseudocode would be like:

For each row aka height value increasing do:

For each time I have to output a space

printf space(s)

For each time I have to output a sharp

printf sharp(s)

next row so not the same height.

For a height of 1 you have "***##**" which is 1 space then 2 #

For height 3 (remember C is 0 indexed so the first row is row 0):

2 spaces 2 # ****##**

1 space 3 # ***###**

*0 space* 4 # **####**

Now you have to find the correlation between the spaces and sharps given a height.

How height (aka row index increasing ) influences each row AND how many spaces and sharps you have?

If you count my little pyramid's** character per row **you see that the SUM of spaces and sharps is always the same.

I hope I 've been able to help you out a bit :)