Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(prime): add JavaScript solution

Đã đóng
#70 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@aadiitya2007 đang làm issue này rồi.

Từ ngày 24/10/2026.

  • #71 của @aadiitya2007 — đã merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Python
Star
1
Fork
6
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của techcsispit/code-corner

Tất cả issue của techcsispit/code-corner

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.