• + 0 comments
    public static void staircase(int n) {
        // Write your code here
        String result = "";
            for (int i=1; i<=n; i++) {
                for (int s=0; s<n-i; s++)
                    result += " ";
                for (int j=n; j>n-i; j--)
                    result += "#";
                System.out.println(result);
                result = "";
            }
        }