What is the significance of the if condition used in the editorial solution?

//work for numbers
for(int cst=1;cst<=nst;cst++)
{
if(cst!=n)
System.out.print(num+"\t");

            num++;
        }

Also why are most of the solutions to the questions in java, when this is a course of c++?

hi @isingh can you please share the whole code? save it on cb ide

/Users/isha/Downloads/pattern_Mountain.java

@isingh see in the last line of the pattern, all numbers are printed twice, but 4 is printed only once
1 2 3 4 3 2 1
so to avoid printing it twice, the condition is used