What can be more elegant ways to solve the given problem.
#
##
###
####
Code:
function StairCase(n) {
for (var i = 1; i <= n; i++) {
var row = i;
for(var j = 1; j <= n - row; j++) {
process.stdout.write(' ');
}
for(var j = 1; j <= row; j++) {
process.stdout.write('#');
}
process.stdout.write('\n');
}
}