Can you please tell me that in which case tle is coming and how to resolve it.
Tle in one of the cases
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