Hello Programmers, In this post, you will know how to solve the HackerRank Staircase Solution. This problem is a part of the HackerRank Algorithms Series.HackerRank Staircase SolutionsOne more thing to add, don’t directly look for the solutions, first try to solve the problems of Hackerrank by yourself. If you find any difficulty after trying several times, then you can look for solutions.HackerRank Staircase SolutionProblemStaircase detailThis is a staircase of size n: 4: # ## ### #### Its base and height are both equal to n. It is drawn using # symbols and spaces. The last line is not preceded by any spaces.Write a program that prints a staircase of size n.Function DescriptionComplete the staircase function in the editor below.staircase has the following parameter(s):int n: an integerPrintPrint a staircase as described above.Input FormatA single integer, n, denoting the size of the staircase.Constraints 0 < n <= 100.Output FormatPrint a staircase of size n using # symbols and spaces.Note: The last line must have 0 spaces in it.Sample Input6Sample Output###############ExplanationThe staircase is right-aligned, composed of # symbols and spaces, and has a height and width of n=6.HackerRank Staircase SolutionStaircase Solution in C#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { int n, i,j; scanf("%d", &n); for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(j<(n-1-i)) printf(" "); else printf("#"); } printf("\n"); } /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }Staircase Solution in Cpp#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; cin >> n; string str(n, ' '); for (int i = 1; i <= n; ++i) { str[n-i] = '#'; cout << str << endl; } return 0; }Staircase Solution in Javaimport java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc = new Scanner(System.in); int i,j,k,n = sc.nextInt(); for(i=0;i<n;i++){ for(j=n-1;j>i;j--){ System.out.print(" "); } for(k=0;k<=i;k++) System.out.print("#"); System.out.println(); } } }Staircase Solution in Pythonn=int(input()) m=" " t=1 while n>n-n: print((n-1)*m+t*("#")) n=n-1 t=t+1Staircase Solution using JavaScriptfunction processData(input) { var h = parseInt(input, 10); var i; var j; var line; for (i = 0; i < h; i++) { line = ''; for (j = 0; j < h - i - 1; j++) { line += ' '; } for (;j < h; j++) { line += '#'; } console.log(line); } } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });Staircase Solution in Scalaobject Solution { def main(args: Array[String]) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ val n = readInt for (i <- 0 to n - 1) { for (j <- i to n - 2) { print(" ") } for (j <- 0 to i) { print("#") } println() } } }Staircase Solution in Pascalvar N, k, i, l:integer; begin readln(N); l:=1; for k := 1 to N do begin for i := 1 to N do begin if i < N - l + 1 then write(' ') else write('#'); end; writeln; inc(l); end; end.Disclaimer: This problem (Staircase) is generated by HackerRank but the Solution is Provided by BrokenProgrammers. This tutorial is only for Educational and Learning purposes. Next: HackerRank Plus Minus Solution Post navigationHackerRank Solve Me First Problem Solution HackerRank Plus Minus Solution