Code giving wrong answer

what is the problem with this code, i know that its complexity is very high but at least it should run for small numbers at least.

here is the code

@Parmeet-Kalsi-1631789033630118 it is running fine for me, but some wrong grids are also so check your canplace function.

I can’t find any mistake in canplace function kindly check what is the issue in it

@Parmeet-Kalsi-1631789033630118 please see line 24-26, it is running fine now

Please mark your doubt as resolved in case you dont have any further doubts