2nd test case is failed but pattern is correct
Your logic is correct but the code does not follow the output format properly.
Please see the problem statement and follow the output format strictly as mentioned there, as there might have to be a space or a tab between the elements in the output.
have done that but still problem is not solved my output is exactly similar to pattern output in challenges.
For input 5
Your output:
1
11
202
3003
40004
But the correct output as given in sample test case
1
2 2
3 0 3
4 0 0 4
5 0 0 0 5
So change the code accordingly and also remember to add tabs between elements in output.