Ad
  • Custom User Avatar

    Some methods are loop-alike, check that out too.

  • Default User Avatar

    I have the same problem(Python). The maximum test that I can get to is 445, and I don't have any failed tests, that's it. I spent hours to solve this kata and at this moment I have at least 2 different solutions, which are definitely not O(n^2), cause I don't use nested for loops or something like that. However, it has nearly 9000 completions, so maybe it's me and I don't undestand how to optimize my code, but at the same time, I've read many comments and still some people have the same issue.

  • Default User Avatar

    I actually imagined this as more like rocks and a truck that is able to carry a maximum weight and a specified number of rocks. Not all katas have great wording, unfortunately. The problem is still interesting, 'though.

  • Custom User Avatar

    Wouldn't the distance change when they drive to a different town?

  • Custom User Avatar

    The link was wrong, not the site. If you read the URL, it says solutions/python/me/best_practice. So it's not incorrect that it shows everyone their own solution.

  • Default User Avatar

    When I click on the above link, it directs me to the Python my solutions page for Sum of Pairs which simply shows my one solution ... instead of JakobHeiden's code. Is this a known thing or a some kind of site glitch worth reporting?

  • Custom User Avatar

    Hi,

    That's actually not "cheating" at all. ;) You found some pattern, you used it. Codewars is "TDD oriented". Meaning that as long as you don't bypass the tests (like, really messing with the testing process itself) and your soluiton passes, it's good to go. If you actually used tricks that wouldn't solve any situation, the responsibility is not on you but on the author (ie. not implementing enough tests).

    enjoy your points & cheers. ;)

  • Custom User Avatar

    This is weird. I'm quite sure I got an O(n) solution. Still I cannot pass an attempt, and no matter how I do the algorithm, it always seems to time out at test 443, which seems to be just a run-of-the-mill short input test. The large n inputs only start at 511 from what I can tell. If I circumvent the large input with dummy results, it does not get stuck at 443. What's going on here? edit: actually I do some sorting, so my solution is at least O(n log n) I guess...

  • Custom User Avatar

    I cheated on a certain kata. I was stumped as to how to solve it, so I tried to coax the system for some information about what test case was killing my solution. In the process I found a pattern in the test cases, which I abused to write a bogus function that would satisfy the test cases but not solve the problem.
    Here it is: https://www.codewars.com/kata/54d81488b981293527000c8f/solutions/python/me/best_practice
    What should I do now?

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    If this is easily 5Kyu, why is it marked as 6Kyu?