Skip to content

Create reverse_factorial_recursive.py#13426

Open
afk-Parth wants to merge 4 commits intoTheAlgorithms:masterfrom
afk-Parth:master
Open

Create reverse_factorial_recursive.py#13426
afk-Parth wants to merge 4 commits intoTheAlgorithms:masterfrom
afk-Parth:master

Conversation

@afk-Parth
Copy link

Description

Added a reverse factorial recursive function under the maths/ folder.
The function attempts to find n such that n! == num and returns n; returns -1 if none exists.

Files changed

  • maths/reverse_factorial_recursive.py

Type of change

  • New algorithm / code snippet

Checklist (mark only what applies)

Overview

  • I have read and understood the CONTRIBUTING.md guidelines.
  • My pull request has a descriptive title that accurately reflects the changes and the description has been filled in above.
  • I've included only files relevant to the changes described in the pull request.
  • I've created a new branch in my forked repository for this contribution.

Code quality & tests

  • My code is relevant to the repository and follows the repository guidelines.
  • I added doctests to demonstrate expected behavior.
  • I ran the project linters/tests locally (if applicable).
  • I added or updated documentation if necessary.

Notes

  • File name uses snake_case and .py extension.
  • I used third-party libraries (if so, describe): ______

If you need anything changed (style/doctest wording/placement), please let me know and I will update the PR promptly. Thanks!

Added reverse factorial recursive algorithm with doctests
@algorithms-keeper algorithms-keeper bot added the require descriptive names This PR needs descriptive function and/or variable names label Oct 11, 2025
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

@@ -0,0 +1,21 @@
def reverse_factorial(num: int, i: int = 1) -> int:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide descriptive name for the parameter: i

@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Oct 11, 2025
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

@@ -0,0 +1,40 @@
def reverse_factorial(n: int, divisor: int = 1) -> int:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide descriptive name for the parameter: n

@algorithms-keeper algorithms-keeper bot added tests are failing Do not merge until tests pass and removed require descriptive names This PR needs descriptive function and/or variable names tests are failing Do not merge until tests pass labels Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant