Beta
Snake Draft
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.
This comment has been hidden.
Yeah, that wouldn't really fix the problem...
const
in JS doesn't mean what you think it does.what would then?
This comment has been hidden.
See above. I marked it as spoiler just in case. The "issue" seems to come from your code.
This comment has been hidden.
I'm not an oracle, so I don't know. Global variables? Confusion?
You can always go to Solutions tab and fork any solution, and play around with it. You can modify tests as you see fit (you will notice that adding
const
doesn't change anything). Tests pass a copy of the array, so the expected result isn't affected by your code.no, i figured everything out. i realised exactly what the issue was. see my solution to see how i fixed that
I saw it. My point was that the tests passed the right arrays, and expected results were correct, so the issue wasn't with the kata itself. I agree that every
var
should be replaced withconst / let
but that's a minor issue (especially considering that the kata is in beta for 7 or so years).Poor description! nth pick stands for number of rounds and it also stands for the position of the element you have to return after completing the rounds!
Your random tests are vulnerable to input modification.
Thanks for letting me know. I just fixed that, and made the random tests be more random. Your solution should fail most of the tests now.
I think you need to update your description on how a snake draft is formed after each round for larger sets.
Don't snake drafts act the same for larger sets as they do for smaller sets? E.g.,
abc...xyz
, thenzyx...cba
, thenabc...xyz
and so on?Are the test cases not doing that?
The thing is that it's not very clear what
nth
means:nth
actually means something like above rather than things like "nth round".I see. I changed
nth
tonthPick
and added a few examples. Does that clear up any confusion?