Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

feat(prime): add JavaScript solution

未關閉
#70 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@aadiitya2007 已經在處理了。

開始於 2026年10月24日。

  • #71 來自 @aadiitya2007 —— 未關閉

評估

難度
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 n from stdin via fs.readFileSync(0, "utf-8").
  • Handle boundary values ($n < 2$ are not prime, $2$ and $3$ are prime).
  • Use an optimized step loop checking divisors up to $\sqrt{n}$ for efficient execution on numbers up to $10^9$.
  • Output prime or not prime matching existing problem specifications.
主要語言
Python
星號
1
分支
6
平均合併
22 小時 41 分鐘
30 天內合併 PR
27

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

techcsispit/code-corner 的其他 Issue

查看 techcsispit/code-corner 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。