Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create num_perfect_squares.py #793

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rashidkalwar
Copy link

Added an algorithm that calculates the least amount of perfect squares that are required to sum a given number fixes #767

@rashidkalwar
Copy link
Author

this file also fixes the issue #769, please review and provide a feedback
also I am new to open source community and to this repo so go easy on me 😄.

@ericklarac
Copy link
Collaborator

@rashidkalwar Add test cases, please


i=1

#Now just chekc for 2 if not 2 return 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

chekc -> check

@@ -0,0 +1,37 @@
"""
Some examples:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add and algorithm description, also add proper test cases

@rashidkalwar
Copy link
Author

just added all the changes as requested please check and merge if all ok.
thanks

Copy link
Collaborator

@ericklarac ericklarac left a comment

Choose a reason for hiding this comment

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

Add test cases please, you can see examples of test cases on this PR

@@ -1,16 +1,20 @@
"""
This Algorithm takes a Integer as a parameter and returns the least number of perfect square numbers that sum upto it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

upto -> up to

@rashidkalwar
Copy link
Author

@ericklarac
I have Added a few test cases just like the PR you referred me, I hope it is good now, if you think there needs to be changes made. please make it yourself.

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.

Add algorithm that calculates the least amount of perfect squares needed to sum an integer
2 participants