Beta
The strictly necessary number of words for reading your numbers outloud
Loading description...
Mathematics
Performance
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.
100_000
random tests are still not OK. Performance testing should be bigger input, not more tests. I also don't understand why this is taggedPerformance
in the first place. Is there even any other implementation that would time out?Improved the tests :3
The reference solution is incorrect. Here is an example:
base = 7
,max = base ** 3 - 1 = 342
. The reference solution returns10
. But the correct answer is7 + 2 = 9
sincemax < base ** 3
.I'll fix it!
fixed
assert.strictEqual
instead ofassert.equal
max
<base
? I think this case should be valid.There are tests where
max
<base
, but with the wrong result, e.g.:The number of words needed to read numbers up to
4
is 5 (including0
) or4
(excluding0
), not 10.Same bug in random tests.
Oh, I thought that even if the
max < base
you would still have words for the leftovers of the system from a proper understading of the system itself. But you both are right. In the way I defined the problem before it makes more sense your wayDescription changed. I think it's more proper to still have the minimum amount of words needed for any max to be
base
.