Pattern double sided arrow(one test case is not working what could be the possible reason) code is attached below

the pattern to be printed for (n=7) 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

Hardcode for n = 1. Your program is giving incorrect answer.