()
| 71 | } |
| 72 | |
| 73 | function problemDirs() { |
| 74 | const base = path.join(ROOT, PROBLEMS_DIR); |
| 75 | if (!fs.existsSync(base)) return []; |
| 76 | return fs |
| 77 | .readdirSync(base, { withFileTypes: true }) |
| 78 | .filter((entry) => entry.isDirectory()) |
| 79 | .map((entry) => `${PROBLEMS_DIR}/${entry.name}`); |
| 80 | } |
| 81 | |
| 82 | function findRepoPath(leetcodeId, dirs) { |
| 83 | const prefix = String(leetcodeId).padStart(4, "0"); |