• Custom User Avatar

    I'm sorry. Please clarify the question. Each of the 3 lists a, b and c are 5K-10K length. This takes time. Agreed?

    The lists are generated by appending to end of list. It's a 6 Kyu, so no need for gymnastics because it works. Clear?

  • Custom User Avatar

    That depends on how the expected result is generated, if the random lists are generated and then the expected result with a control function, that would be expensive. Maybe one random list should be generated and then the three lists generated with some elements in common with that, that sounds cheaper. Note: I hadn't see the testing suite myself, only guessing.

  • Custom User Avatar

    Ok, I passed the tests...

    But I wonder how test generation can take such a long time, these are just random lists.

    Maybe lists with a special pattern?

    Thanks.

  • Custom User Avatar

    Nope, that 9s is reference solution + test generation and validation. It might be the case that reference solution actually takes 1s while rest of the time get eaten up by the test generation and validation.

  • Custom User Avatar

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

  • Custom User Avatar

    thank you my friend. apparently i forgot to delete those from my code. i often use print statements to see whats wrong with my code in my interpreter. when i copied my solution here i forgot to delete those print statements.
    finally my code works without time complexity. im so happy to finish this kata.

  • Custom User Avatar

    Thx. I'll add to all.

  • Custom User Avatar

    Print statements use a lot of space. Comment out print statements if you have any.

  • Custom User Avatar

    Buffer size quickly runs out if you use print().
    Try commenting out all print statements.

  • Custom User Avatar

    Sure. Thanks!

  • Custom User Avatar

    i fixed that problem, now a new one arised. space complexity

  • Custom User Avatar

    my code errors: max buffer size reached. is it due to space complecity? how large are the test inputs really?

  • Custom User Avatar

    With your solution, you will parse b and c, a times (On² solution, that is)... maybe you could try to parse each array only once.

  • Custom User Avatar

    Please add the following test case to Haskell:

    common [1,2,2,3] [5,3,2] [7,3,2] `shouldBe` 5
    

    This test case will invalidate several incorrect solutions.

  • Custom User Avatar

    Great kata !

  • Loading more items...