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.
Why are the results so truncated? I can't debug my code with something like:
With k = 1, arr = 47,81,43,130,32,107,311: expected 'Rearrangement: 107, 130, 311, 32, 43,…' to equal 'Rearrangement: 107, 130, 311, 32, 43,…'
Cool kata! First tried the brute force approach and timed out. Then realized this is a puzzle and not a plotting exercise. Gave it some thought away from the computer and came up with a solution.
Fun to solve. Thanks. Good graphics in the description - very helpful.
I'd suggest adding a test case for when the mean is equal to one of the found numbers. I was passing the random tests most of the time until this scenario occured.
I meant that a direct link to the trainer should never be used. Sorry for not being clear.
The description still is very convoluted. Second part of point 2 is useless. Point 3 looks useless and/or doubtful:
Are you sure you don't mean
aba999 -> abb001...
? If the descriptino is currently right, the problem is that you're litterally flooding the user writting a lot of times examples that are not making obvious what they want to demonstrate. Ex: in the code block I pasted just above, there are 4 infos. the important one at this point is the link when changing of line. Except that any user reading this will normally associate "one line == one idea". That's the natural way to like at this.About the tests:
var
createRandomTests
function is useless: just build all the tests inside theit
block, using a first loop (and so, you won't needvar
)a
or a0
(use floor, not ceil. Beware of the upperbound, doing so)Cheers
I made changes based on your comments. Does it look any better?
I tried to paste my solution into the index.js file on the linked website but it seems to be read only. I even logged in but no dice.
Hi,
If you're interested in authoring kata you should read the docs first.
Cheers
Could anyone explain this solution?
You're a genius!
In the description under Examples you show the output for sample test 4 being { A: 114, B: 90, C: 106, D: 116 }. That is the output I get but the test yeilds this result:
expected { A: 114, B: 90, C: 106, D: 116 } to deeply equal { A: 118, B: 94, C: 110, D: 120 }