Ad
  • Default User Avatar
  • Default User Avatar

    I guess that settles this issue...

  • Default User Avatar

    Yes, I understand your comment, but this evidently does not apply here, because old solutions still pass in all language versions. An they pass by a wide margin. Less than 9000ms is well below th cut-off

  • Default User Avatar

    As a quick first test I ran a few of the most recent accepted solutions and oldest solutions (see below) using Node v14.x (results for other nodes in parentheses). Indeed, some of the recent solutions time out. Maybe they passed with older nodes, but I tested that for only one. The three oldest solutions all pass consistently by a wide margin. There is some significant variation in time for subsequent attempts, possibly connected to server load. I ran these tests on a Saturday afternoon European time.

    Conclusion, the kata still works. It is not enough to have just any logarithmic complexity algorithm. Also the code needs to be performance optimised. This is possible: monadius' solution is on average 15% faster than my initial solution.

    I hope that helps. Good luck!

    recent sollutions:

    old solutions:

    • my initial solution: 8743ms, 8603ms, 8610ms (Node v10.x 8228ms, Node v12.x 7157ms)
    • solution by dfhwze: 8302ms, 9648ms, 10015ms
    • solution by monadius: 7794ms, 7963ms, 6388ms
  • Default User Avatar

    I'll look into that. Just give me few days, I am a bit on a tight schedule at the moment.

  • Default User Avatar

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

  • Default User Avatar

    Sorry, my question was not well phrased. I understand, the requirement is only up to a million. But the algorithm used in the lambda will also work for larger numbers. But how large? I think "one billion" should be the first number that doesn't work anymore, or am misreading the code?

  • Default User Avatar

    In the last line of the Sample Test Cases a closing brace is missing. Should read:

        }
    };
    
  • Default User Avatar

    Thank you, for the Julia translation. Unfortunately, I have never used Julia before, so I am not sure how I could properly review your translation. Would someone proficient in Julia please review the translation and give me some feed-back, if they can't approve the translation themselves? Cheers!

  • Default User Avatar

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

  • Default User Avatar

    yes, I believe it is reasonalby hard :-) at least that was the intention.

    algorithms that are linear in the input interval will certainly fail. But also logarithmic complexity algorithms might fail if they are not efficiently implemented.

  • Default User Avatar

    I doubt that there are still undiscovered mistakes in the test cases

    in 10000 big numbers : failed for start -5443201352402228954 end -5058817742765882381 returned: 65519527597645617 should equal 0
    first of all, this is not in Fixed Tests but in Random Tests

    the error messages means

    • the random interval started at -5443201352402228954
    • the interval ended at -5058817742765882381
    • in this interval, all numbers contain the digit five, therefore, the return value of the function should equal 0
    • your function, however, returned: 65519527597645617 instead.

    conclusion: The test works as expected.

    ??? 0 start not = end

    Unfortunately, I have no iea, what you wish to express. I you believe there is a mistake (which might very well be the case) try to make a proper argument and carefully describe, why you believe something is wrong. It is a huge pain to try to guess what some hastily typed comment might convey.

    and in edge cases: 44 should equal 0 (start and end don show)

    there is no matching edge case. Neither in the example test nor in the submission tests. Start and end don't show up for the fixed tests because you can see the values after successful submission, which is not the case for Random Tests, obviously.

  • Default User Avatar

    well, if you can do it for 3 digits, you probably can do it for 1 digit. And then you are probably already very close to the solution. Good luck.

  • Default User Avatar

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

  • Default User Avatar

    since I don't know your code I wouldn't be able to tell. The submission tests contain a large number of random tests. So if your code contains any inefficiency, it will certainly time out.

  • Loading more items...