Ad
  • Custom User Avatar

    In JavaScript console.log(array) can be used for this purpose. I don't know about other languages

  • Custom User Avatar

    This Kata would benefit greatly with an example of the failed test case, instead of the expected equal alone. The basic test case is not enough for this Kata.

  • Custom User Avatar
  • Custom User Avatar

    Same thoughts. I'm moving on rather than hitting my head against a wall.

  • Custom User Avatar

    From the description:

    If two numbers in the argument array have the same number of digits, return the first one in the array.

    10760 = 5 digits,
    17204 = 5 digits,
    95013 = 5 digits,
    6474 = 4 digits,
    42 = 2 digits

    So, the max amount of digits is 5. Since there are multiple that have length 5, take the one that comes up first. And that is 10760.

  • Default User Avatar

    Log
    [ 1, 10, 100 ]
    100
    [ 9000, 8, 800 ]
    9000
    [ 8, 900, 500 ]
    900
    [ 3, 40000, 100 ]
    40000
    [ 1, 200, 100000 ]
    100000
    [ 7000000, 10, 100 ]
    7000000
    [ 30744, 220584, 48, 58140, 155610 ]
    220584
    [ 14036, 0, 21889, 20880, 217080 ]
    217080
    [ 10760, 17204, 95013, 6474, 42 ]
    95013
    expected 95013 to equal 10760;
    Bro, what the hack?! Look at the last line. How should it work lol?

  • Default User Avatar

    This should be a 6kyu. Thanks.

  • Default User Avatar

    On the test example "new int[] {-10, 1, 0, 1, 10}" the result should be -10 even tho -10 and 10 have the same amount of DIGITs and on the random test "new int[] {1308500879, -1807002044}" even tho 1308500879 and -1807002044 have the same amount of DIGITS...............

    i completely don't understand the logic of this kata since the numbers are not selected by the number of their digits and neither by the number of the CHARACTERS of each number (-10 has 3 characters over 2 character in 10 but they both have the same amount of digits....... but -1807002044 has 11 characters and 1308500879 as 10 characters even tho both have the same amount of digits).

    So in conclusion i don't understand at all what this kata wants and i don't think it works properly.

  • Custom User Avatar

    The kata seems to be tricky at best, or even underspecified.
    Your solution most probably returns incorrect answer for inputs like int[] { 21, -10, 212 }.

  • Default User Avatar

    I did everything according to the instructions and generated code that measures the length of the string. The tests go fine, but when I press "Attempt", it throws an error- "expected: <1874011478> but was: <-1974269008>"

  • Default User Avatar

    Enjoyed it. Hope to see more like this.

  • Default User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    OP solved it, closing

  • Default User Avatar

    This kata has no clear discription and exmaples!!!

  • Loading more items...