I am not able to apply concept of whole pattern i am only able to half of it

hi @architsuryavanshi are you sure you have shared the correct code for this pattern ?
the pattern is

                            1 
                        2 1   1 2 
                    3 2 1       1 2 3 
                4 3 2 1           1 2 3 4 
                    3 2 1       1 2 3 
                        2 1   1 2 
                            1 

But your output is

1 
 
1 2 
  
1 2 3 
   
1 2 3 4 
    
1 2 3 4 5 
     
1 2 3 4 5 6 
      

hi @architsuryavanshi i think you have misunderstood the question, the part you have printed till now is not correct.
if n = 7, this means that the total number of lines = 7, and you have to print till n/2 + 1, ie 4. Try to understand what the pattern is really doing. The code for n = 5 should be till 3. You are basically taking the numbers till n-1, which is not the case.

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.