how could i create an array with specific elements that look like this -
let n = 5
let arr = [
[0,0,0,0,0,1,0,0,0,0]
[0,0,0,0,0,2,1,0,0,0]
[0,0,0,0,0,3,2,1,0,0]
[0,0,0,0,0,4,3,2,1,0]
[0,0,0,0,0,5,4,3,2,1]
[1,2,3,4,5,0,0,0,0,0]
[0,1,2,3,4,0,0,0,0,0]
[0,0,1,2,3,0,0,0,0,0]
[0,0,0,1,2,0,0,0,0,0]
[0,0,0,0,1,0,0,0,0,0]
]
And then, when we increment the value of n, we can get this -
let n = 6
let arr = [
[0,0,0,0,0,0,1,0,0,0,0,0]
[0,0,0,0,0,0,2,1,0,0,0,0]
[0,0,0,0,0,0,3,2,3,0,0,0]
[0,0,0,0,0,0,4,3,2,1,0,0]
[0,0,0,0,0,0,5,4,3,2,1,0]
[0,0,0,0,0,0,6,5,4,3,2,1]
[1,2,3,4,5,6,0,0,0,0,0,0]
[0,1,2,3,4,5,0,0,0,0,0,0]
[0,0,1,2,3,4,0,0,0,0,0,0]
[0,0,0,1,2,3,0,0,0,0,0,0]
[0,0,0,0,1,2,0,0,0,0,0,0]
[0,0,0,0,0,1,0,0,0,0,0,0]
]
Is something like that even possible? I know that I need to use the for loop for this, but still cant wrap my head around this.