Pattern double sided arrow

I an not able to solve the problem.Can you please share the logic.

break down the pattern into 2 portions upper and lower (lower is just reverse of upper)

in upper portion further breakdown into 4 portions

  1. Spaces (n-2*i)
  2. print numbers from i+1 to 1 (dec)
  3. print spaces 2*i-1
  4. print numbers from 1 to i+1 (make sure that if i=0 then don’t print 1)

lower portion just reverse the upper portion

I have commented each steps in reference code so that you can understand it
Reference Code

2 Likes

@singhsaurabhlps7_18d9f31919917399
if you want to ask something feel free to ask
and if you doubt resolved plz give your feedback

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.