Beta
Double Down
Loading description...
Algorithms
Arrays
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 doesn't do anything. Those functions are always immediately called in the test suite ( they don't need to be, but they are ), they are never exposed, and the test suite doesn't leak them to the user solution. The source is inaccessible anyway, and if it weren't,
Function.prototype.toString.call
would still work on them because you didn't disable that.That code can be removed without any consequences whatsoever.
done
The
act
indirection in the example tests was, to me, quite unreadable. May I suggestinstead of the current situation? I could not make out which arguments went to which function, with function calls nested up to three levels deep.
done
yield* [1, 0, 1, 1, 0, 0];
instead offor (let n of [1, 0, 1, 1, 0, 0]) yield n;
0 <= element of ns <= 10,000
( but why is it called "element of ns" instead of "index" !? )If indices would be in order ( even if there might be duplicates ), solver would not have to cache results ( which is ugly ) but could generate them on the fly. It's a design decision, but if non-descending indices had been guaranteed, I would have gone for the elegant solution. Just saying.