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

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

  • returns any valid X point for where a Y value passed into get_x(y, graph_len=0) exists

    self_power_list = [1, 1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420489]
    
    test.expect(get_x(i ** i, len(self_power_list)) == i
    

    Apparently it should also accpet 0 as returned value when i == 1

  • Hi,

    Your assertion messages are not helping at all. things like Should still be able to find a later element in a graph featuring a plateau should be titles used for it/describe blocks, not the assertion messages. Using test.expect without showing the actual and expected answers is pretty bad.

    Other than that, it's "yet another bisection kata". So, it's unfortunately a duplicate, so you should unpublish it (iirc, there is a completely equivalent setup somewhere in the database).

    cheers

  • No random tests in any language.

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

  • Python, Ruby (maybe other languages too) use Test.expect.

  • In Rust, there is no test case covering potential arithmetic overflow issues that are present in most accepted solutions. I think such a test case should be added or the instructions should be explicit about the range of the input numbers.

    Such a test case might be something as simple as [-128, 127] with target 0.

  • By the way the instructions are worded "return the first two values",in the case study [10, 5, 2, 3, 7, 5] it should give a result of [5,5]. It will only give a result of [3,7] if the instructions stated "return the first AND closest pair of values". I've seen over and over again people passing all tests, but this one and later redoing the whole code to accomodate this specific scenario when if corrected the ennuciate wouldn't be a problem.

    To pass the kata you gotta ommit the instruction and base your code on passing that specific case. And the (return undefined if the numbers don't add up to the solution).

    I suggest proper concise wording

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

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

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

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

  • I'm pretty sure theres a bug in the random tests.

    n=1 should return 1 but it's expecting 2 some how.

    Dart

     Random tests
       Testing for n = 1
        Expected: <2>
        Actual: <1>
    
    
  • Test.assert_equals should be used instead.

  • Loading more items...