Hollow Rhombus Pattern java

https://ide.codingblocks.com/s/54620
https://hack.codingblocks.com/contests/c/588/54

I have printed the hollow rhombus but how to print this pattern?

Hey,In this question you also have to keep a count of number of spaces(nsp) initialized as n-1 and number of middle spaces(msp) which is initialized as n-2 and your number of middle spaces(msp) are everytime remaining the same but csp are being decremented by one everytime you go to another row,so try doing your code using this approach now.

By following code/method you can create hollow rhombus pattern in java

public class HMRhombusstar

{

public static void main(String[] args)

{

Scanner sc=new Scanner(System Resources and Information.);

System.out.println("Enter N : ");

int n=sc.nextInt();

System.out.print("Enter Symbol : ");

char c = sc.next().charAt(0);

for(int i=1;i<=n;i++)

{

for(int j=i;j>0;j–)

{

System.out.print(" ");

}

if(i==1 || i==n)

for(int j=1;j<=n;j++)

{

System.out.print©;

}

else

{

for(int j=1;j<=n;j++)

{

if(j==1 || j==n)

System.out.print©;

else

System.out.print(" ");

}

}

System.out.println();

}

}

}