5 kyu
Give The Biggest Prime Factor And The Biggest Divisor Of A Number
202 of 337raulbc777
Loading description...
Fundamentals
Algorithms
Mathematics
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.
Approved +1
Cheers!
I tried to change the description to include the extra part about floats for Julia, but I don't see that appearing in the Julia description... Is there something I missed on how to do that?
Perhaps doing a new translation for the Julia version and you add what you think is necessary for people interested in solving it in Julia. Approve it by yourself if this is useful
I made the Julia translation just like the Python one, but the description for the kata has a language dependent part, since not all languages test for floats. I added Julia to the list of languages in that part of the description, but I don't see that change appearing when I look at the Julia description. This change in the
diff
section of the translation if you want to have a look. Do we need to merge that? Or should it be accepted separately?I asked for some help. I haven't done translations for almost five years.
Thanks! I think I found the issue. There was an unnecessary colon at the end of the list of languages which seeems to have kept the last language from being included in the if clause. After removing that, there are JavaScript, Python, Ruby and Julia which state the test for floats in the description. Python and Julia are correct, if the others are not, the description should be modified.
Ok. Let's see.
The description should give the range of the input (
90_000_000
) and number of tests.Should be language-agnostic too
Optimization and fast algorithms are a key factor to solve this kata
should be removed since a lot of non-optimized and memoised solutions can be found submitted successfully ~~Ruby 3.0 should be enabled
Missing
end
in initial solution setupUndeclared variables should be removed in initial solution setup
Unnecessary logs in tests should be removed
Python new test framework should be used
Missing
:
in initial solution setupUndeclared variables should be removed in initial solution setup
Unnecessary logs in tests should be removed
Done
JS Node 14. should be enabled
Missing end curly bracket in initial solution setup
The undeclared variables should be removed and just
return []
in initial solution setupIn JS the test expects
The number has a decimal part.
and notThe number has a decimal part. No Results
as stated in the description.Unnecessary logs in tests should be removed
Go translation
Approved both translations into GO and RUST. +2
Rust translation
Fixed.
after a couple of Reset pushes it worked
A good translator +1
Thanks @dfhwze for your good observation +1
D translation. I have not included the input validation part requiring to return a string in case the number is a float with a decimal part. It is something hard to handle in strict typed languages in a non artificial and uselessly complex way, and this is a very trivial task for a 5 kyu kata. Input validations are not appreciated today and this would be probably removed if the kata was published today. I understand the kata is old and when it was published the criterias were different. I hope it's not a problem.
Yeah, perhaps 6 years ago.
Looks like there is an issue with translation
Language?
Indeed there was an issue with big primes, fixed. Thanks.
@akar-0, @depial has a question for a translation of this kata in julia above. Could you be so kind? Thanks
At least Ruby, probably other languages too: missing edge case tests with powers of pries (like 4 or 9). A few published solution don't handle this case correctly.
Those edge cases have been included in both fixed and random tests in Go, Rust and D.
Added to Python too.
In JS the test expects "The number has a decimal part." and not "The number has a decimal part. No Results" as stated in the description.
Thanks for considering my katas. I'll do the corrections at night (in four hours).
Reraised above. And yeahh it's been 17 months and not four hours XD :-)
The description should give the range of the input and number of tests.
Reraised as issue
Reraised as issue! And difficulty is subjective as ranks are shared among languages
There is a discrepency between the intructions and the actual tests. Numbers with a decimal part should return "The number has a decimal part. No Results", but instead you test for "The number has a decimal part."
Please specify language (I suspect JS), and mark it as an issue.
Yes, this is the JavaScript version.
Approved
JavaScript local test cases should use AssertSimilar instead of AssertEqual.
Thank you very much for your good observation. The problem was only in the example tests. It's fixed.