Hel with pattern mountain

im getting an extra number cant figure out how to remove it

Add a if-else statement to check if it is the last row before last inner for loop:
int b = a-2, if it is satisfied.
int b=a-1, otherwise.

Hope, this would help.

BTW even if you would be able to correct your code, it wouldn’t help you to score anything.

Hint: Read the Explanation sectoon of the question .

I am marking this doubt as resolved as you have not replied to this thread for 11 days.
In case, you still have some doubts regarding the same problem, you can reopen this doubt.

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.