Skip to content

feat: add happy number checker - #3265

Open
nishithadaryn wants to merge 1 commit into
TheAlgorithms:masterfrom
nishithadaryn:add-triangle-area
Open

nishithadaryn wants to merge 1 commit into
TheAlgorithms:masterfrom
nishithadaryn:add-triangle-area

Conversation

@nishithadaryn

Copy link
Copy Markdown

Description of Change

Adds an implementation of the happy number check in math/happy_number.cpp.
It repeatedly replaces a number with the sum of the squares of its digits and
uses a set to detect cycles. Includes self-tests.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Adds a happy number checker using digit-square sums with cycle detection.

This branch has not been deployed

No deployments
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.

1 participant