it’s a example in our data structure class
I really can’t think step by step how this code works…
my brain hurts…
like the more I think i just got more confused…
var n = 10;
var x = 0;
for(var i=1;i<=n;i++) {
for(var j=1;j<=i;j++) {
for(var k=1; k<=j; k++) {
x = x + 1;
}
}
}