4 kyu
N-th Integer Containing the Digit 1
19 of 46M1Miketro
Loading description...
Number Theory
Performance
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.
.
This thing expects different results in JS and Python:
This comment has been hidden.
A real issue is that random tests are broken in JS.
let
orconst
must be added beforerandom
:Also,
+ 1
should be added to ensure that only positive numbers are tested.So my solution should not be able to pass JS then?
Fixed.
I don't recommend to use
Math.ceil(Math.random() * n)
instead ofMath.floor(Math.random() * n) + 1
because there is a small chance thatMath.random()
returns0
.Also fixed.
Execution Timed Out (12000 ms)
I'm very sure this kata has been done before, but with the digit
5
instead. The task is 99% the same after changing the digit.I can't find the kata right now though, since it doesn't have a usual name.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.