Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I don't think the test suite is complete. The problem description says it should be sorted by most frequent letter and then alphabetically for letters with the same frequency. I used tupList = sorted(tupList, key = lambda tup: tup[1], reverse=True) as my sort which doesn't account for sorting alphabetically in the event of matching frequencies, but I passed the kata.

  • Custom User Avatar

    Did anyone figure out a solution better than O(n^2)? Is it possible?

  • Custom User Avatar

    I passed the test suite and went back to clear out print statements / add comments. Now it times out and says unknown error whenever I submit. The submit button has turned dark and I can't press it anymore. Possibly a code wars server issue? Edit: It shows taht I passed in my completed kata section. Code wars just won't allow me to submit again and says to check my internet connection (i did, it works).

  • Custom User Avatar

    Does importing pi within the function provide an advantage over importing it at the top?

  • Custom User Avatar

    My first attempt was to try and return l.reverse(). I kept getting "None" as a result. Can someone explain why you have to do l.reverse() then return l instead of return l.reverse()?

  • Custom User Avatar

    It seems like everyone is doing the same thing with pass. I didn't pass or return and it worked. Is pass safer or better practice? How does it compare to an empty return?

  • Custom User Avatar

    It's unlikely a powerful machine will pass the test with a slow algorithm. If you're using an O(N^2) algorithm and the input size is 10 million, 10 million squared is 10 trillion. The naive implementation here will run in N^2 / 2 which is 5 trillion. Even if you can run through 1 billion base operations per second it will take minutes to complete.

  • Custom User Avatar

    I've had this happen on the server sometimes. I try to test it with something super simple like a console.log() or 1+2. If it still happens I just go take a break. It fixes itself on their end.

  • Custom User Avatar

    similar to what floydchen said, the ENTIRE PAIR 3 and 7 comes before the second value of 5,5 so it's counted as earlier

  • Custom User Avatar

    This kata needs more information about the wind speed. Speed is a scalar unit, but the direction of the wind is important here. If I'm bearing 90 degrees and the windDirection is also 90 degrees then it will be a Headwind or Tailwind based on the direction of the wind. I think there are problems with the test suite as well. I'm getting the right value for all the head and cross winds, but the expected directions on some tests are just wrong (based on my assumptions about wind direction which work for about 60% of tests). I printed the rwy heading and wind Direction for each of them to see why I kept failing some tests and a rwy heading of 3.14159 and windDirection of 3.66519 means that the cross wind is definitely coming from the left. It could just be that my assumptions are wrong, but it would help if the instructions had more detail.

  • Custom User Avatar

    Can I get some clarification on how the matrix works and rules for getting from one element to another? Are the process lists constructed based on actual steps for achieving some outcome like the steps to bake bread being gather (wheat I assume), mill the wheat, bake, and have bread or is a process based on adjacency of elements in the matrix? Either way, I need further explanation on how the example test results in "['gather', 'mill', 'bake']"

  • Custom User Avatar

    Am I supposed to return the string in a form with new line characters written out like "aaa\nbbb\nccc" I'm getting an error

    "Returned 'apples, pears
    grapes
    bananas' but expected 'apples, pears
    grapes
    bananas'"

    and I haven't been able to figure out why. Is there even a difference between my current output and the expected "apples, pears\ngrapes\nbananas" or is it just formatted by the console?

  • Custom User Avatar

    My editor does not auto indent and keyboard shortcuts (ctrl+c\v\x) are disabled. ctrl+z still works for some reason. I cannot find a way to change editor settings or reset to a default state.

  • Custom User Avatar

    I have used code wars on two different computers (javascript environment / kata). On one, I can use keyboard shortcuts like ctrl+c\v\x\etc... and on the other I can't. It doesn't even autoindent when I move to a new line. Can anyone explain why this is and how I can fix it.

  • Loading more items...