Ad
  • Custom 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

    @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

  • Custom User Avatar

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

  • 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.

  • Custom User Avatar

    I've tested Python and it worked just fine, there is no test with "there".
    "often" is an exception and "of" isn't in the 6th test.