6 kyu
Climbing the Leaderboard
71 of 145Firefly2002
Loading description...
Arrays
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.
Oh for fnarghing fnargh, passing 277 tests, FNARGH!!
This comment has been hidden.
Add ruby to issues below (-> random tests are too random).
In Python (2 and 3), I timeout even if I just return an empty list without any computing. Am I missing something?
Unfortunately, no... Python's had issues on Codewars for the last year or so. There's no way to adjust the tests to an appropriate level of complexity at the moment that would hold up in the future, to the best of my knowledge.
This comment has been hidden.
Approved ;-)
Thanks! :)
This comment has been hidden.
This comment has been hidden.
I believe I've fixed this (see issue below). I tried your solution a few times without that check and it passed.
P.S.: I've now got that song stuck in my head, so thanks for that 😂
:-)
generateScores
has small chance to generate a array of length 0 (I actually encountered twice) So the input will be likeAnd reference solution will return
[ <6 empty items> ]
where it should be[1,1,1,1,1,1]
You may also consider to add cases where scores array is empty
Bah, I thought I had fixed that. Thanks for letting me know. Is it happening across all test, or just the very small ones, do you know?
Very small chances, like about one case in serveral attempts.
I believe I've fixed the issue. It was actually worse than I'd thought... a lot of arrays were having a lot of empty items because of some copying and pasting and then failing to modify a variable or two. Had to change some of the tests as a result... no one's been invalidated though.
Um... what changes have you made? Try this
The code which makes it empty is
Just change it to
will simply solve the problem.
Oh.. looks like we were actually noticing two different issues involving
empty
.Fixed. Was having weird issues with other people's code getting invalidated even though they were valid.
Looks like smile67's solutions are a hair too slow most of the time and so got invalidated after I tweaked the tests a little.
Just a trick of randomness, even you set a hugh number 5000000, by
~~(Math.random() * len)
, sometimes it gives a smaller result, sometimes a bigger one in range [0,5000000)Yep :) Thanks for the help, Zed.
;-) so once again...
just saw one solution got valid again;-)
Phew! ;)
Since this whole Kata is about Kara then why is the function argument called alice?
https://www.youtube.com/watch?v=zw08Py5nz1w
LOL. Touché 😂
Fixed, I forgot it was still alice in the solution setup :)