7 kyu
Next Featured Number Higher than a Given Value
452 of 925raulbc777
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.
python new test framework is required. updated in this fork
Approved!
Kata description should explicitely mention the max allowed value and the message to be returned in that case.
Ruby 3:
Please review: C++ Translation
Approved +1
JS Node 14. should be enabled
Initial solution setup should be return 0
Unnecessary logs should be removed
Python new test framework should be used
Initial solution setup should be return 0
Description should be language-agnostic
Should also explain the case for no requirements met instead of mentioning it through example tests only
good kata
Python 3 should be enabled.
Done.
I know my submission was not correct at all, but it passed the test anyways. I think we need a mathematical proof for this kata. Something like, there exists an y value so that if val < x < val + y, there will always be an x value that satisfies the instruction.
Another Kata, another timing issue. I'm left once again with "Process was terminated. It took longer than 6000ms to complete". My code is simply 6 lines and uses 1 loop. I've also timed my kata and the average time it takes to run on my own machine is 1.1 millisecond. Many other times is 0.6 milliseconds. What gives?
Which language, which code? Add your code with spoilers. If it's python, do you use Python3 on your machine? Codewars uses Python2. Keep in mind that Python2's
range()
will actually create the whole list, whereasxrange
act (mostly) the same as Python3'srange
.This comment has been hidden.
Use (GitHub flavored) markdown:
That being said, try your function on
9999999999
on your machine.Completed the kata with a very dirty, hard coded solution. I felt like a cheat but then realised everyone else did the same thing. I'd love to see an answer that doesn't hard code any digits.
Suggestion: Add tests for large numbers with lots of duplicated digits. For example: 9000000000
Doing so would almost certainly cause my solution (and perhaps many others) to timeout looking for an answer - thereby requiring a smarter solution.
I agree that this particular kata has many details that may fasten the code solver. But what you suggest perhaps corresponds to a hardcore version of it. Don't forget that it's a 7kyu kata. Btw, I saw your solution and you deserve extra points for it.
Seven years late, but your comment inspired me to use a less conventional approach for my JavaScript solution.
That's great! You mention big-O in your solution -- it's great to see folks that care about that. I would like to take lots of the kata on CW and create performance versions of them. Good job!
Javascript template is broken!
What specific problem did you find?
the javascript template is incomplete.
First of all, have you solved the kata? I looked for your solution.
I don't need to to know the javascript template is broken :(
no, I haven't submited my solution yet
Ok. It's my third authored kata in Javascript. 26 people solved it in that language. But if you've got an advice to improve it. You're welcome.
If you click train and go on reset the javascript template looks like this
That's not ideal considering it's missing a bracket and has an undefined variable, I think it should be fixed not for my sake but for beginners who choose to attempt this kata...
Thanks for your observation. It's fixed now!
Ruby translation kumited.
This comment has been hidden.
Is "0" odd? 99 -> 105 (105 contains 0, so isn't it 135?)
The numbers are odd. Digits may be odd or even.
Ah.. ok... thanks and sorry for misunderstanding;-)