plz help me with this. I am getting a small error
Hollow diamond pattern
You can divide this problem into 2 parts. In first part print the upper half and in second part print the bottom part.
In both the parts first print required no. of spaces, then 1 asterisk, then again required no. of spaces and then again 1 asterisk.
Pls try this question on paper and figure out that in one line how many no. of spaces are printed and what is itβs relation with the line no. and length of pattern. Try to figure out the traid/pattern in no. of spaces across different lines.
Also first try it with _ underscores first instead of spaces like this:
_ _ _ *
_ _ * _ *
_ * _ _ _ *
*_ _ _ _ _ *
_ * _ _ _ *
_ _ * _ *
_ _ _ *
You can refer this for the logic:
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.