Ad
  • Default User Avatar

    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)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Note you can only have one mini win per sub array.

  • Default User Avatar

    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)
    }
    }

  • Default User Avatar

    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?

  • Default User Avatar

    testBasics passed on RUN SAMPLE TEST

    testBasics fail on Attempt in PHP

    Is it me or code?, please take a look!! How can I dump out expected result to hand check?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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:

    1. 15.551...
    2. 16.555...

    Or (if calculated as floating point number till end)

    1. 15.556...
    2. 16.624

    So round, floor, or ceil never gives same answer for both (well, that is, unless we are expected to use other constraints)

  • Default User Avatar

    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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    no matter how I look, this is just overkill!!

  • Default User Avatar
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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.

  • Default User Avatar

    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...