Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
"Ok, lesson is over. Let us do a task with while."
Not clear?
We use the same method, but I am reminded that "specified syntax is not used"(while||do while)
Cool I guess
It doesn't matter what the author says (and however politely he does so), the true specifications are defined by the tests that the user has to pass; the description only serves as a warning about what the user will have to deal with. That's how TDD/BDD works, and how CW works respectively.
In fact, it's the author's fault that his "anticheat" is so weak, and you can bypass it easily.
Okay, fair enough. Parsing is another level of complexity though. And still, the description and title are there, and they're 100% explanatory about the requirement of using a "while" loop. So not having a test for it, is not an excuse. But that's just how I see it, fine with me if you have a different opinion on that.
Of course. You have access to the solution in
/home/codewars/solution.txt
. You can read that file and parse it.But would it be possible to do it from the CodeWars unit tests environment?
It's as possible as V8, the javascript engine that powers chrome and nodejs, is able to interpret the code to run it. It's called parsing.
That's the title of the kata...
...and that's the first sentence in the task description :) (But maybe the description changed after you posted the solution? Sometimes it happens in CodeWars...)
It's impossible to write a test case veryfing whether you used a loop or not.
Cool I guess? I don't see it explicitly required anywhere. My solution wasn't flagged as insufficient by the test cases. So it is sufficient to pass the task suite.
That's a clean solution, but has rather high computational complexity for sorting 2 arrays
You could make it even simpler with
Object.values
instead ofObject.keys
and thus avoid[]
accessorsThat's the nicest solution, but the task asked specifically to use a while loop, sooo...