Ad
  • Custom User Avatar

    Ah, I see. I misread the output. Thank you.

  • Custom User Avatar

    Not an issue, the first value is what your function returned, not the input value, for the first one, the input was "foobar99". If you want to see the input value, print it, it'll appear above the test result.

  • Custom User Avatar

    I'm solving on Python. The logic I'm seeing in the tests seems to me internally inconsistent. Examples:

    'foobar00' should equal 'foobar100'
    whereas in the sample tests: Test.assert_equals(increment_string("foobar00"), "foobar01")

    I'm also seeing:

    foobar10' should equal 'foobar01'
    shouldn't this be 11??

    Thanks

  • Default User Avatar

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

  • Default User Avatar

    In Python I get the error.
    261998765738225392543588155392 should equal 261998765738225395043321056933
    So for small numbers is works pretty good. How can I handle bit int in python?

  • Default User Avatar

    I have the same issue. Did you figured out what was wrong?

  • Custom User Avatar

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

  • Default User Avatar

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

  • Custom User Avatar

    @dagro - my point was to use your tests to see how much work you can get done before timing out
    See how fast you can generate it for a number up to 300,000 and go from there :)
    My first successful attempt managed 8.5 seconds for that one number
    It took me the better part of 3 evenings to make everything happen in < 7s and I would not have believed it possible at first

  • Custom User Avatar

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

  • Default User Avatar

    Thank you. I checked it. For the number 50 my code needs 349 rounds in the loop and for no. 100 is 723 rounds. Pretty sure, i can make it better. But just to check no. 100 it is one round.

  • Custom User Avatar

    There really are three separate problems to handle

    • Generating the numbers efficiently
    • Avoiding repetitive work (wink wink)
    • Delivering the results efficiently (there is a certain module that can help with that, or you can reinvent the wheel like I did :) )

    You can intentionally fail your tests at certain points and optimize these portions of your solution separately e.g. by using a single test case with an increasingly higher number or by adding a class variable which counts how many times a function has been called and start returning zeroes after that to fail the test.
    This way you will get much better feedback than 'oops, wrong'

  • Custom User Avatar

    Your program should remember what it has and has not done. That's all really ¯\_(ツ)_/¯

    But I would also suggest you try your solution with different big inputs. You may be thinking that passing all 5000 tests is your main problem but it is also possible that your code is not efficient enough to compute performant_numbers(N) where N > 150,000.

  • Default User Avatar

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

  • Default User Avatar

    Thank you for the fast respond. Now I also works fine vor me.

  • Loading more items...