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.
Great solution! But could you also kindly sprinkle some few lines of comments for your short var names (if you don't mind) so people (like me) grasp in shorter time
example like what
mx_nd
is about (took sometime to figure out)This comment is hidden because it contains spoiler information about the solution
Note you can only have one mini win per sub array.
input
[27, 27, 26, 48, 41, 44, 32, 35, 31, 42, 45, 37, 48, -53, 34, 40, 45, 21, 38, 33]
output:
array(8) {
array(2) {
[0]=>
int(2)
[1]=>
int(352)
}
[1]=>
array(2) {
[0]=>
int(3)
[1]=>
int(336)
}
[2]=>
array(2) {
[0]=>
int(5)
[1]=>
int(165)
}
[3]=>
array(2) {
[0]=>
int(7)
[1]=>
int(98)
}
[4]=>
array(2) {
[0]=>
int(11)
[1]=>
int(77)
}
[5]=>
array(2) {
[0]=>
int(13)
[1]=>
int(26)
}
[6]=>
array(2) {
[0]=>
int(17)
[1]=>
int(34)
}
[7]=>
array(2) {
[0]=>
int(19)
[1]=>
int(38)
}
}
Hand checking the input gives correct answer (at least for the couple of inputs i've checked). Can you please give me one input and expected result pair for
testRandom
input so I can test it on my local machine to test?testBasics
passed onRUN SAMPLE TEST
testBasics
fail onAttempt
inPHP
Is it me or code?, please take a look!! How can I dump out
expected
result to hand check?This comment is hidden because it contains spoiler information about the solution
If you've read the assumption, I've mentioned which part to cover, but it's obvious someone have skipped that!
FYI The results of referred test are:
Or (if calculated as floating point number till end)
So round, floor, or ceil never gives same answer for both (well, that is, unless we are expected to use other constraints)
I passed it too.
One look at test's expected result, one can guess it means
% of "remaining"
but in a subject that deals with Math, my opinion is, "guess" is not a good way to go!!"A description can't give the solution and a bit of reasoning is needed."
Also by saying it's
% of "remaining"
does not give the solution at all, but it clarifies and one is not required to guess it by having to look at test's expected output.Bottom line is, as noted in my post, it lacks clarity.
This comment is hidden because it contains spoiler information about the solution
no matter how I look, this is just overkill!!
Good Math!!
This comment is hidden because it contains spoiler information about the solution
Having ran out of ideas, unlocked solution to see that the solution on top of the list is similar as the code I wrote save for
$author
.Google search does give me that result.
https://bugs.php.net/bug.php?id=69761
But am unable to pass this kata test with that error!
Loading more items...