Can you help me with the curent qestion

i have tried it but its not working

its my code

@chemant077

What you did wrong is you considered only one situation
if(canPlace) place

you didn’t consider the other one
don’t place in this cell and continue (Line 48 in modified code marked // Here)

Here is the modified code