Ad
  • Custom User Avatar

    There are already many arithmetic expression search katas. What makes this kata special from those ones?

  • Default User Avatar

    I added asserts in the test cases (and in the solution for some checks at another level). Please tell me if there remain some issues.

  • Default User Avatar

    Ok, I will study that. Thanks for the feedback!

  • Custom User Avatar

    Messages from tests are not really helpful:

    • ValueError: list.remove(x): x not in list, or
    • ValueError: not enough values to unpack (expected 3, got 1), or
    • TypeError: cannot unpack non-iterable int object,
    • ... etc

    It would help if tests did some preliminary checks and explained what is an actual problem rather than crashin.

  • Default User Avatar
  • Default User Avatar

    If somebody sends me a link to this kata, does it count as being rickrolled?

    It's just to know whether I should punch them or not.

  • Default User Avatar

    Apparently cubic time passes the test. Ashamed to have had to submit though.

  • Default User Avatar

    Thank you too. :-)

  • Default User Avatar

    Modified, thanks.

  • Default User Avatar

    I wanted to check whether this kata existed, and now I have confirmation I fear the moment when I try it. :-)

  • Default User Avatar

    For the test in Caml, we get a warning because of the use of the now deprecated functions (lower|upper)case. It would be nice to edit the kata and replace by the same function with _ascii appended to the name.

  • Custom User Avatar

    Worked perfectly for me. My solution is rather naive (I could optimize it further if it had timed out... :)) - I reckon this is good to go, I don't reckon it's less than 4kyu.

  • Custom User Avatar

    Fair enough :)

  • Default User Avatar

    Hi,

    Actually, the rules forbid the use of nonpositive integers, as well as non integers.
    Your solution may as well be [[2, '-', 1], [6, '+', 25], [100, '-', 1], [31, '+', 99], [7, '*', 130]], which would be accepted.

    I am confident that the implementation of this rule is easy and will validate your code. :)

  • Custom User Avatar

    Hi, I'm seeing a strange error. As far as I can tell my answer is correct for the first given test, it produces one of the 60ish valid solution permutations.

    But during your validation phase, it seems the code fails with no explanation of the reason:

    Test Results:
     Log
    Input  - numberslist: [1, 2, 6, 7, 25, 100], target: 910
    Result - val: 910, error: 0
    Output - solution: [[1, '-', 2], [6, '+', 25], [100, '+', -1], [31, '+', 99], [7, '*', 130]]
    
    STDERR:
    Traceback:
       in <module>
       in execute
    AssertionError
    

    Are you expecting a specific solution, and if so, what criteria are you using to determine which solution should be returned of all the available solutions?

  • Loading more items...