N Queen Hard Timeout

I have used optimized approach for checking if placing a queen is ok or not but still it is showing timeout. Can anyone please help me.

BROO,
c++ java code are debugged here, if u could do the same in either of the language I could help u

Is there anyone who could help me in python

@sanjeetboora Please direct this doubt to someone who knows python

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.