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.
That´s exactly my case here... I just cannot give up yet, but I keep on staring at the code and wondering if it´s the serve´s fault
You can't rearrange the words and they have to be consecutive in the array.
Sorry, but I had the same question, and I do not see why your question is wrong. '3452' is shorter than 'wkppv'. Why is the former included and not the latter?
Sorry, I noticed I had sorted the array before printing final result.
However, I still hope for the instruction to be clearer for people like me, who thought of sorting array based on its length or alphabet order, which would still be applied for the "abigailtheta" example.
I had also spent a long time fixing error because I thought for multiply cases with the same length, the choosen element would be in alphabet order.
Edit: I have to expand this question with another issue:
This time, I did print out the first
$strarr
. My assumption is the test array would be$strarr = ['it', 'wkppv', 'ixoyx', '3452', 'zzzzzzzzzzzz']
.Why wouldn't 'wkppv' be chosen, even though it had the same length as 'ixoyx', stayed first in index order and was longer than '3452'?
Edit2: Okay, problem fixed. I realize the problem was not the code, but me being a dum-dum who couldn't understand english word. Sorry.
You're wrong, print the input to see it, you shouldn't change the order of the strings.
'wlwsasphmxx' + 'owiaxujylentrklctozmymu' = 'wlwsasphmxxowiaxujylentrklctozmymu'
Working with PHP 7 here.
After multiple failure, I had tried to see exactly which array was being tested, and here is the result:
So apparently the tested array is
$strarr = ['owiaxujylentrklctozmymu', 'wlwsasphmxx', 'wpgozvxxiu']
and$k = 2
.You would think the result would be "owiaxujylentrklctozmymuwlwsasphmxx", but no, it's "wlwsasphmxxowiaxujylentrklctozmymu".
Be it an index order or alphabet order, that's plainly wrong. By the way, this is in the basic test.
I don't think without "return" you can send any output with this method.
To any future PHP fella who got the "Execution Timed Out" error: It's not because of the server, or the question. Think of all possibilities and try your best (even if it took you 2 hours just staring at the code and wondering why you didn't just spam "unlock solutions" button already)
I have no idea the test in testBasics is different from sample test, thus the misunderstanding. Thanks for the clarification.
OK, thanks.
You are not failing this test:
$this->revTest(bouncingBall(30.0, 0.66, 1.5), 15);
but this one (not in "RUN SAMPLE TESTS" but in fixed tests of "SUBMIT":$this->revTest(bouncingBall(30, 0.75, 1.5), 21);
.If you had printed the input and your output you could easily have seen that...
In the description you have read:
But it is only un example (it is written for example).
Below you should have read:
From that you see that bounce is a parameter, not a constant.
Is that clearer now?
This comment is hidden because it contains spoiler information about the solution
I didn't notice that you were using a custom function for sample and fixed tests, but the "built-in" one for the random ones. Everything's alright then.
I know I could be sometimes wrong (more often than I would...)
Can you see below?
I notice that lots of guys passed the PHP translation. It would be weird if nobody had seen that:-)
There is something I don't understand. PHPUnit test definition is:
assertEquals(mixed $expected, mixed $actual[, string $message = ''])
and when you "RUN SAMPLE TESTS" the function "$this->revTest(bouncingBall(30.0, 0.66, 1.5), 15);" gives (look the definition of revTest)$this->assertEquals(15, bouncingBall(30.0, 0.66, 1.5));
. Hence "expected" is 15.I would have understood you got "Failed asserting that 21 matches expected 15." No offense but did you exactly copy what PHP Unit returns?
Could you post your code with three backticks at the beginning and three others at the end so that your code is correctly indented? Moreover mark your code as spoiler. Thanks.
Not enough information. If you're still having this issue, you can easily investigate it yourself, by limitting the number of loop iterations and logging the changes in your variables.
Loading more items...