Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
One floor:
Four floors:
This comment is hidden because it contains spoiler information about the solution
Practially, it doesn't make any difference. The init method automatically returns none, so you don't need to include that instruction in your code. The 'pass' keyword does nothing, it is basically just a placeholder to keep Python from getting angry that you didn't include an indented block in the init method. If you used an empty return, or return None, you'd get the same results, you're just doing a little more work than you need to.
@moonrhino68, I think that on the pc on which you can use the shortcuts has No Editting Mode Enabled(VIM or ENAC), while on the other pc anyone of them is enabled.
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.
Did anyone figure out a solution better than O(n^2)? Is it possible?
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).
No, I think it's the same... if you don't need pi outside the function.
Does importing pi within the function provide an advantage over importing it at the top?
This comment is hidden because it contains spoiler information about the solution
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()?
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?
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.
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.
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
Loading more items...