6 kyu
Friendly Pairs I
221 of 241erdos2n
Loading description...
Number Theory
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
This comment has been hidden.
Really interesting challenge, compliments for the kata.
Python 3.10 fork.
Approved
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
Fixed in both ruby & python
Ruby translation kumited, including slightly improved description. Please check and approve
Thanks for the approval!
This complains about a missing
div_sum
method, when running the test cases.Sorry, it should be fixed now!
Hi anter ~~ can you refer to the issue above? same goes for python ^^
"Friendly"
, but the tests expect"Friendly!"
friendly_numbers
, instead offriendlyNumbers
(see note below)Note: to fix the naming in a compatible way, put this at the top of the test suite:
...and rename all appearances of the function name (also in the sample test, solution, etc. boxes)
All of the above are now fixed, and more :-)
Approved
I almost declared that an issue, but... Well, in python that works...
=> it's bad practice to return different type of output so you should always return a string. "Friends!" for example.
Note that in some languages, it's impossible to return different types of output with the same function.
Great suggestion! Update: Made the edit and republished.
Well, I have some others, actually ;)
Two (EDIT: well... not only... x-D ) more things:
Test.decribe("...")
before each of your loops to present the tests, so one knows what this is about'Friendly! X/Y both!"
?)This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I made more edits to the explanation and added more test cases. I'm going to mark as resolved, if there's more to do, let me know. Thanks again!
Floats should be left on without rounding when you compare the abundancies of the two numbers
;)it's all fixed now...i think :)