Ad
  • Custom User Avatar
  • Default User Avatar

    Thank you for quick response! Now I understand

  • Custom User Avatar

    Before that part of the text:

    ...If there are multiple solutions (and there will be), return as far as possible the result with the largest possible values:...

    You need to take the solution with largest possible value for numbers with multiple possibilities

    Now, back to what you asked

    decompose(11) must return [1,2,4,10]. Note that there are actually two ways to decompose 11², 11² = 121 = 1 + 4 + 16 + 100 = 1² + 2² + 4² + 10² but don't return [2,6,9], since 9 is smaller than 10.

    Since [1,2,4,10] has 10 which is bigger than all of the numbers in [2,6,9], you should return [1,2,4,10] instead.

  • Default User Avatar

    what's wrong with 9 being smaller than 10 if 10 is not even part of the returned sequence?

    "but don't return [2,6,9], since 9 is smaller than 10."

  • Custom User Avatar

    Not a kata issue.

  • Custom User Avatar

    Please, use issue flag/tag only when it's a problem with the kata.

    Closing.

  • Custom User Avatar

    Your code is too slow for this problem. You need to optimize your approach.

    Not a kata issue.

  • Custom User Avatar

    Your code being too slow is not a suggestion.

  • Custom User Avatar

    The sympy module is not among the external packages available on Codewars, you'll need to simplify the equalities manually, closing

  • Default User Avatar

    Timed OutPassed: 67Failed: ?Exit Code: 1
    Test Results:
    Log
    [4, 3, 2, 1, 0]
    [1, 1, 0]
    Fixed tests
    Initial_tests
    (7 of 7 Assertions)
    Completed in 0.59ms
    Random tests
    Small_random_tests
    (50 of 50 Assertions)
    Medium_random_tests
    (10 of 10 Assertions)
    Large_random_tests
    STDERR
    Execution Timed Out (12000 ms)
    Why did my code time out?
    Our servers are configured to only allow a certain amount of time for your code to execute. In rare cases the server may be taking on too much work and simply wasn't able to run your code efficiently enough. Most of the time though this issue is caused by inefficient algorithms. If you see this error multiple times you should try to optimize your code further.

  • Default User Avatar

    Timed OutPassed: 35Failed: ?Exit Code: 1
    Test Results:
    Log
    [1, 2, 4, 10]
    [1, 3, 5, 8, 49]
    Full test suite
    Static tests
    (12 of 12 Assertions)
    Random tests
    (23 of 23 Assertions)
    STDERR
    Execution Timed Out (12000 ms)
    Why did my code time out?
    Our servers are configured to only allow a certain amount of time for your code to execute. In rare cases the server may be taking on too much work and simply wasn't able to run your code efficiently enough. Most of the time though this issue is caused by inefficient algorithms. If you see this error multiple times you should try to optimize your code further.

  • Default User Avatar

    Timed OutPassed: 125Failed: ?Exit Code: 1
    Test Results:
    Log
    5
    4.5
    Basic Tests
    2 Arrays
    (2 of 2 Assertions)
    3 Arrays
    (2 of 2 Assertions)
    Edge Cases
    (2 of 2 Assertions)
    Completed in 0.16ms
    Random Tests
    Small Tests: 5 arrays, each with up to 20 elements
    (50 of 50 Assertions)
    Medium Tests: 10 arrays, each with up to 1,000 elements
    (50 of 50 Assertions)
    Large Tests: Up to 15 arrays, each with up to 2,000,000 elements
    (19 of 19 Assertions)
    STDERR
    Execution Timed Out (12000 ms)
    Why did my code time out?
    Our servers are configured to only allow a certain amount of time for your code to execute. In rare cases the server may be taking on too much work and simply wasn't able to run your code efficiently enough. Most of the time though this issue is caused by inefficient algorithms. If you see this error multiple times you should try to optimize your code further.

  • Default User Avatar

    Time: 544ms Errors: 1Exit Code: 1
    Show All
    STDERR:
    Traceback (most recent call last):
    File "/workspace/default/tests.py", line 1, in
    from solution import simplify
    File "/workspace/default/solution.py", line 3, in
    from sympy import symbols, Eq, solve
    ModuleNotFoundError: No module named 'sympy'

  • Default User Avatar

    This comment has been deleted.

  • Default User Avatar

    Timed OutPassed: 10Failed: ?Exit Code: 1
    Test Results:
    Log
    ['Liquor', 'Vodka', 'Mint', 'Pineapple', 'Watermelon']
    Basic tests
    Simple tests
    (5 of 5 Assertions)
    Impossible cocktails
    (2 of 2 Assertions)
    Not enough ingredients
    (2 of 2 Assertions)
    Ice: taste = 0
    Completed in 9.37ms
    Performance tests
    26^2 ingredients (5 datasets)
    STDERR
    Execution Timed Out (12000 ms)
    Why did my code time out?
    Our servers are configured to only allow a certain amount of time for your code to execute. In rare cases the server may be taking on too much work and simply wasn't able to run your code efficiently enough. Most of the time though this issue is caused by inefficient algorithms. If you see this error multiple times you should try to optimize your code further.