7 kyu
Array of Primes
471tdowek1
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.
It's not clear from the description whether the
start
andend
of the range are inclusivefixed
"You can assume that parameters numbers will be positive integers and that the start of the range will be less than the end of the range."
This should be removed from description, as it's not true.
fixed (updated JS to Node 12. as well)
You can assume that parameters numbers will be positive integers and that the start of the range will be less than the end of the range.
Except that random cases have cases where start > end.
fixed (updated JS to Node 12. as well)
Though in random tests section start of the range can be more than the end.
My code passed the test cases but when I submit, a couple of cases fail. I don't know what cases are failing though. Can I get info about the failing test cases?
Kata translated (as usual, two languages and let me know if you find both); I would object on the efficiency of your solution (in private, if you wish) and I must say I am more of Balkoth idea about returning an empty array, but as a mere translator, I kept your choice :)
Though I can't find one just now, I'd be surprised if this kata is not a duplicate considering how many prime-number-related katas there are.
It would make a lot more sense to return an empty array instead of
null
when there are no prime numbers in the range.1 is not a prime number.
Right you are. I'll change it now.
I have changed the kata now, thanks for the feedback!