You will be given a number N. You have to code a hollow diamond looking pattern

I am not able to solve the ques I don’t know how to. please help

hi @akshat1409, refer here its a well commented code

hope this helps :slight_smile:

This does help but i am not able to solve these questions on my own. What to do?

your answer is being shown as wrong but it is showing the correct solution in the pattern. Why is that?

hi @akshat1409,
remove spaces from everywhere there is an extra space for clarity (check the code updated)

@akshat1409, dont worry u will be able to solve it with time and experience

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.

in the solution in the 2nd part(while drawing the lower half) why cant we use a normal counter like we used in the first half of the pattern (int i =0;for i<n;i++). Why do we take reverse counter?

hi @akshat1409, because the shape is also reversed the upper half r

cant we initialize i again for the lower half of the code to make a normal counter for lower half of pattern?

hi @akshat1409, you can try it out this was just one way to implement it, if you have something different please try it out and if having difficulties reach out to us

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.