Tle in one test case

import java.util.*;
public class Main {
public static int count=0;
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
nqueen(new boolean[n][n],n,0,0,0,"");
System.out.println(count);
sc.close();
}

public static void nqueen(boolean[][] box,int n,int row,int col,int qpsf,String ans){
    if(n==qpsf){
        count++;
        return;
    }
    if(col>=box[0].length){
        col=0;
        row++;
    }
    if(row==box.length){
        return ;
    }
    
    if(isSafe(box,row,col,n)){
        box[row][col]=true;
        nqueen(box,n,row,col+1,qpsf+1,ans+" {"+row+" , "+col+"} ");
        box[row][col]=false;
    }
    nqueen(box,n,row,col+1,qpsf,ans);
    
}
public static boolean isSafe(boolean board[][], int row, int col, int N)
{
    int i, j;
    /* Check col*/
    for (i = 0; i < N; i++)
        {if (board[i][col])
            return false;
        }

    /* Check this row on left side */
    for (i = 0; i < col; i++)
        {if (board[row][i])
            return false;
        }

    /* Check upper diagonal on left side */
    for (i = row, j = col; i >= 0 && j >= 0; i--, j--)
        {if (board[i][j])
            return false;
        }
        /* Check lower diagonal on left side */
    for (i = row, j = col; j >= 0 && i < N; i++, j--)
        {if (board[i][j] )
            return false;
        }

    /* Check upper diagonal on right side */
    for (i = row, j = col; i >= 0 && j <N; i--, j++)
        {if (board[i][j])
            return false;
        }

    

    return true;
}

}

your code is giving wrong answer for n=11 , your code output is tle correct output is 2680
use optimzesolution
if Queen is placed in particular row then change row value