Domanda di colloquio di TikTok

Solve N queen problem. How many possible ways are there?