Ad
  • Custom User Avatar

    I submitted a 40 LOC solution, now I feel sad and I don't think I want to code anymore

  • Custom User Avatar

    oh man this is cool

  • Custom User Avatar

    look at the basic operator types, if you did what I did you probably have type issues instead of rounding issues. i.e. look at integer division instead of the division operator that returns a float.

  • Custom User Avatar

    For data, you can construct a vector (or std::array) with fixed size 255.

  • Custom User Avatar

    Looks fine to me now?

  • Custom User Avatar

    Ok. I think that it is a problem that the test suite outputs horrendeous amounts of crap if one of the big tests fail and I'm not sure how to solve this so that it is possible to figure out what tests are failing.

  • Default User Avatar
    @simonvpe:
    It makes heavy use of the cache and the complexity is O(1) in best case, and O(n) in case there are only nested "bogus" sequences like [[<>]].

    Do you mean, O(n) iterations through the source_code string? That gives you O(n2).

    UPD. My bad, I've got your idea just now. It seems to be optimal enough, but there may be small hateful bug, which makes you suffer.

    P.S. Finally there is one solution (except mine), so I believe that kata is solvable.

  • Custom User Avatar

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

  • Default User Avatar

    It takes at most 2 seconds to test my solution (I've tested it right now - it took 1364ms).

    If you cannot pass the performance tests section, probably your code isn't optimal enough. What is time complexity of your solution?
    Also, big output may be caused by the error in the solution. 'DoTest' function tries to output actual and expected results, which can be quite large.

  • Custom User Avatar

    I have the same problem.

    The example tests are ok, but the complete tests can never be done. It seems the problem with the performance of the tests (too big, too much for the codewars resources).

  • Custom User Avatar

    I'm having some problems with the build server. I've optimized in several iterations and have reached a point where I beleive my code is efficient enough, but I keep getting these stupid problems with the builds (only the "Attempt" builds, the "Run Examples" works fine).

    Sometimes it complains about JSON errors, sometimes I get HTTP 500, and currently I'm stuck with "Failed to process output. It is possible that too much data was written to STDOUT." even though I don't write anything at all to stdout.

    I think that the tests might be a bit on the heavy side for the servers, what do you think?

  • Custom User Avatar

    Dude please don't use std::list. It is incredibly slow and useless.

  • Custom User Avatar

    I found the description somewhat confusing. Lots of words not describing the ultimate goal for the kata. I suggest to shorten it and make it more algorithmic. Something like:

    • Make an algorithm that sorts according to blabla, for this and that reason (motivation)
    • Make one pass i = [0...n-1] on words X = [X[0],...,X[n]]
    • If X[i] < X[i+1] and i is odd, swap
    • If X[i] > X[i+1] and i is even, swap (or whatever the order was)

    But there might have been a reason to be vague in order to make the problem harder, in that case i think it would make sense to give some motivation so that it is possible to get an idea about the problem domain and what exactly we are solving.

  • Custom User Avatar

    Yes indeed, elixir version messed up. The tests are not checking against a string

  • Custom User Avatar

    I can't figure out how to review :P

  • Loading more items...