Solve the N-Queens problem | TikTok Interview Question