7 kyu
Simple Fun #184: LCM from m to n
161 of 566myjinxin2015
Loading description...
Fundamentals
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.
Too hard for 7 kyu. BruteForce solution is maybe 7 kyu but to reach good time complexity to pass the test without be timed out you need to have more experience.
Very good and funny Kata! Thanks to author!!!
C Translation (author inactive).
approved
Amazing Kata!
python new test framework is required. updated in this fork
Approved
C# warnings ->
tests/Fixture.cs(146,15): warning CS0219: The variable 'passed' is assigned but its value is never used
This comment has been hidden.
Ruby translation should be updated 3.0, see relevent information here: https://github.com/codewars/content-issues/wiki/List-of-Ruby-Kata-to-Update
Enabled in this fork + Tests cleanup
Nice solutions guys. I just couldn't see the math behind it so I chose the hard way (kind of 5kyu kata in this way of 60 lines of code ;) ).
Python translation: function name in prefilled solution template is
press_button
instead ofmn_lcm
.Thanks :]
I think the instructions should say: Your task is to find the smallest number which is evenly divided by all numbers between m and n (both inclusive).
OK, description modified. Thanks ;-)
I still don't understand what we are looking for here. EDIT: nevermind, just a LCM reduction over a range.
Why C# code obliged to return double?
because some results are larger than int32 ;-)
This is a very strange way to overcome such trouble, IMHO. Why not use long or BigInteger?
Is this a serious problem? I just like to use
double
when dealing with some big numbers. If this is banned in CSharp, I will modify it. Thanks ;-)No, it's not a problem really (at least in this simple task) and it is not banned in C#, of course. I just don't like such way because it's bad practice, IMHO. Never mind, I'm just a stickler and a perfectionist. :)
PHP Translation Kumited - please accept :D
Done ;-)