Skip to content

feat: add Armstrong number algorithm - #1918

Open
sarthakgupta1907-cell wants to merge 2 commits into
TheAlgorithms:masterfrom
sarthakgupta1907-cell:feat/armstrong-number
Open

sarthakgupta1907-cell wants to merge 2 commits into
TheAlgorithms:masterfrom
sarthakgupta1907-cell:feat/armstrong-number

Conversation

@sarthakgupta1907-cell

Copy link
Copy Markdown

Describe your change:

Add implementation of the Armstrong Number (narcissistic number) algorithm in Maths/ArmstrongNumber.js.

An Armstrong number is a number equal to the sum of its digits, each raised to the power of the number of digits.

  • Example: 153 = 1³ + 5³ + 3³ = 153 ✓
  • Example: 9474 = 9⁴ + 4⁴ + 7⁴ + 4⁴ = 9474 ✓

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

codecov-commenter commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1918      +/-   ##
==========================================
- Coverage   85.91%   85.89%   -0.03%     
==========================================
  Files         379      379              
  Lines       19778    19800      +22     
  Branches     3016     3016              
==========================================
+ Hits        16993    17007      +14     
- Misses       2785     2793       +8     

☔ 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