feat(prime): add JavaScript solution
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, node.js
- 領域
- backend
研究方向
The issue names the existing solutions in problems/prime/ and asks for solution.js; read those solutions and the problem specification first. Implement the stated stdin handling and primality checks, then confirm the output is exactly prime or not prime for the boundary cases and inputs up to 10^9.
由索引模型根據 Issue 內容生成。
描述
Description
The prime problem currently provides solutions in C (solution.c), C++ (solution.cpp), Python (solution.py), and Java (Solution.java), but does not have a JavaScript solution.
Proposed Solution
Add problems/prime/solution.js implementing primality checking in Node.js:
- Read input number
nfromstdinviafs.readFileSync(0, "utf-8"). - Handle boundary values ($n < 2$ are
not prime, $2$ and $3$ areprime). - Use an optimized step loop checking divisors up to $\sqrt{n}$ for efficient execution on numbers up to $10^9$.
- Output
primeornot primematching existing problem specifications.
- 主要語言
- Python
- 星號
- 1
- 分支
- 6
- 平均合併
- 22 小時 41 分鐘
- 30 天內合併 PR
- 27
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
techcsispit/code-corner 的其他 Issue
-
prime/solution.java doesn't compile: public class PrimeCheck in solution.java, README requires Solution.java with a Solution class可能已有人在做 @tanujb03 於 16 天前認領。 未關閉bug good first issue
難度 1/5 1 小時以內 新手友好度 82/100
techcsispit/code-corner#35 ·
維護者通常 1 天內回覆
-
feat(roman-numerals): add C solution可能已有人在做 @aadiitya2007 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 35/100
techcsispit/code-corner#72 · 1 則留言 ·
維護者通常 1 天內回覆
-
feat(anagram): add C solution可能已有人在做 @aadiitya2007 於 4 天前認領。 未關閉
techcsispit/code-corner#68 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
feat(binary-search): add C solution可能已有人在做 @aadiitya2007 於 4 天前認領。 未關閉
techcsispit/code-corner#64 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
test(palindrome): add test cases for single-char, numeric, and punctuation edge cases可能已有人在做 @aadiitya2007 於 4 天前認領。 未關閉
techcsispit/code-corner#62 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 techcsispit/code-corner 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
sylvainmetayer/homelab#851 ·
維護者通常 1 天內回覆
-
needs triage
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
kubeflow/docs-agent#279 ·
維護者通常 3 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
維護者通常 1 天內回覆