From ad7f723b177e851e062da107271334ae3cb47da8 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Tue, 30 Sep 2025 22:49:30 +0900 Subject: [PATCH] 20250930 baekjoon --- code_study/Baekjoon/ts/9663.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 code_study/Baekjoon/ts/9663.ts diff --git a/code_study/Baekjoon/ts/9663.ts b/code_study/Baekjoon/ts/9663.ts new file mode 100644 index 0000000..ec28dea --- /dev/null +++ b/code_study/Baekjoon/ts/9663.ts @@ -0,0 +1,30 @@ +export {}; + +const N: number = Number(require("fs").readFileSync(0).toString().trim()); + +let queen: number[] = new Array(N).fill(-1); +let count: number = 0; + +const isSafe = (depth: number): boolean => { + for (let col=0; col { + if (depth === N) { + count++; + return; + } + + for (let n=0; n