Ad
  • Default User Avatar

    thanks !

  • Custom User Avatar
  • Custom User Avatar

    While there is no performance, the input constraints are mentioned in description. With 10^5 input, the expected time complexity should be less than O(n^2). Your code looks to have O(n^2) because of operations like .splice or .indexOf nested in a loop.

    However, there was an issue raised about it below and seemingly O(n^2) should be accepted now? Maybe there are some inconsistencies between tests of different languages, that's up to the author to clarify.

  • Custom User Avatar

    Forked to fix description, approved fork.

  • Default User Avatar
    1. Issue tag is for the issues with a kata, such as broken test cases, incorrect descriptions etc. Next time please post a Question.
    2. Without you posting your code with a spoiler flag, it is a guesswork to try to help you. Looking how there is no performance tag and my first naive solution passed in 2500 ms, my guess is you got infinite loop somewhere in your code.
  • Default User Avatar

    Help Execution Timed Out (12000 ms)

  • Default User Avatar

    on_line(((1,1))) should be on_line(((1,1),))

  • Default User Avatar
  • Custom User Avatar

    Actual test:

    Reference solution needs improvement:

    print(repr(sol(0)))             # 'NaN'
    print(repr(sol(-0.0)))          # 'NaN'
    print(repr(sol('.18wJTrx')))    # '0.18'
    print(repr(sol(9.702833161595592e-05))) # '9.70'
    
    """Ambiguous: Are these valid numbers?"""
    print(repr(sol('4')))           # '4.00'
    print(repr(sol('\n7')))         # '7.00'
    print(repr(sol('+')))           # '0.00'
    print(repr(sol('-')))           # '-0.00'
    print(repr(sol('\t')))          # '0.00'
    
  • Custom User Avatar

    top solution got invalidated after spec update

  • Custom User Avatar

    Approved

  • Custom User Avatar

    Fixed in latest fork

  • Custom User Avatar

    Approved

  • Custom User Avatar

    Hmmm it seems like you didn't read the comment at the top of the JS test cases, let me copy paste it here:

    // NOTE FOR FUTURE TRANSLATORS
    // Please, don't translate this kata to languages that have support for big/long int
    // Unless you're indeed sure that you can remove / prevent / block the use of big / long int
    // Some example of languages that can't be used for translation are Python and Ruby
    

    I specifically mentioned Python as one of the language that this kata shouldn't be translated to.

    Even if you (after reading this) have found a way to block the use of large integer in python, there might still be holes that you forgot to handle or there might be new holes added at later version of python. It would be hard to maintain in the future.

    So, I'm sorry, I'll have to reject the translation. Thank you though for the time you put on creating it.

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Loading more items...