Skip to content

feat: add Perfect number algorithm - #1919

Open
sarthakgupta1907-cell wants to merge 1 commit into
TheAlgorithms:masterfrom
sarthakgupta1907-cell:feat/perfect-number
Open

sarthakgupta1907-cell wants to merge 1 commit into
TheAlgorithms:masterfrom
sarthakgupta1907-cell:feat/perfect-number

Conversation

@sarthakgupta1907-cell

Copy link
Copy Markdown

Describe your change:

Add implementation of the Perfect Number algorithm in Maths/PerfectNumber.js.

A perfect number is a positive integer equal to the sum of its proper divisors.

  • Example: 6 = 1 + 2 + 3 ✓
  • Example: 28 = 1 + 2 + 4 + 7 + 14 ✓

Checklist:

  • I have read CONTRIBUTING. md.
  • This pull request is all my own work—I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new JavaScript files are placed inside an existing directory.
  • All filenames are in the format MyAlgorithmName.js -- PascalCase.
  • All new algorithms have a URL in their comments that points to Wikipedia or another similar explanation.
  • All new algorithms have tests, and the tests pass.
  • All code is formatted with npx standard --fix .

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.91%. Comparing base (5c39e87) to head (db479a4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1919      +/-   ##
==========================================
- Coverage   85.91%   85.91%   -0.01%     
==========================================
  Files         379      379              
  Lines       19778    19776       -2     
  Branches     3016     3020       +4     
==========================================
- Hits        16993    16991       -2     
  Misses       2785     2785              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants