3 kyu
No More 5's, Ever
57 of 77M1Miketro
Loading description...
Number Theory
Mathematics
Memoization
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.
How much of Combinatorics does this kata need? Like I guess around 30%-40% is all about combinatorics to find the numbers which contain "5" in them.
Have
test.assertEquals(no5s(16384, 32768), 0, 'a = 82, b = 43')
in JS version again.Great problem super tricky
This comment has been hidden.
There is something wrong with the test cases. It gives an output "a = -50029, b = 21093: expected 29800 to equal 11654", but in VS Code console.log() it is actually 29800. Could you please fix it.
Placeholder, I notice in Python the solution setup is not correct. I'll fix it.
fixed
solution
andcodewars_test
tyjsdfgbwr
,jewthysgfkwenhfdg
, etc. I am not sure if there is any reason to use obfuscated names, but if there is, at least provide original names as a comment, or something.Javascript:
compat
module instead using mocha directly.Most like paranoia of user code getting a reference of the reference solutions. But then when properly done, you can't really do that without doing stuff that's definitely considered cheating.
It's been fixed. Would you like to try?
Hi guys, as the first 10 positive numbers that should be counted are 2, 3, 4, 6, 7, 8, 9, 11 the fixed test test.assert_equals(no_5s(2, 10), 7, 'a = 2, b = 10') should report 6 and not 7. Shouldn't it?
No. How do you expect 6 valid numbers instead of 7, between 2 and 10 (inclusive)?
11 is not inside 2 to 10...
ok
The new sample tests added later have incorrect message strings, like
test.assert_equals(no_5s(16384, 32768), 0, 'a = 82, b = 43')
.(Also, there should be bigger inputs in sample tests. Not as big as to time out using the simplest approach, but takes around 1-2 second to finish.)
Fixed
JavaScript: do not use
@codewars/test-compat
. Replacetest.assertEquals
withassert.strictEqual
whereassert = chai.assert
.Fixed.
In random tests,
no_5s(-24583, -9886)
expects an answer of 11570. This cannot be the correct answer, as most of the 11570 numbers are five-digit numbers. Or does the rule apply differently to negative numbers?This comment has been hidden.
Fixed.
What is "up" or "down" when looking at negative numbers?
You see the mess that gets created when introducing such specifications? I BEG you to take out ANYTHING that is not INTEGER from the specs.
Fixed.