Pattern triangle

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();

	int nst=1;
	int nsp=n-1;
	int val=1;
	int row=1;
	while(row<=n){
		//space
		for(int csp=1;csp<=n;csp++){
			System.out.print("\t");
		}
		for(int cst=1;cst<=nst;cst++)
		{
			System.out.print(val+"\t");
			val++;
		}
		int cst=1;
		if(cst<=nst/2)
		val++;
		else
		val--;
	}
	System.out.println();
	nsp--;
	nst+=2;
	row++;
	}

}

hey @karthik1989photos
Modified code

sir when i m submitting the code it is again showing TLE error

kk i got it the program went correct

@karthik1989photos
I see that you have got a correct answer in the question.