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.
xor solution is n. Most efficient
Good one! You also are good writing without "!=0" because boolean for "0" would be "False" anyway, and all others would be "True!
I used set, but actually this one is shorter, maybe it's more expensive if talking about productivity...
Thank you!
Please read the description. That input isn't valid for this kata.
I think the same than you, maybe its correct because they dont put a test in order like you write but its a posibility so for my is not the correct answer
This comment is hidden because it contains spoiler information about the solution
oh that's smart, I didn't think of the set, but I think I did one step better by just making a range of min, max of the seq
This is an elegant and the most pythonic way of solving the problem however it results in a time complexity of O(n^2)/ space complexity of O(1) whereas if someone did a dictionary its only O(n)/space complexity of O(k). It may be great in terms of space however in thousands to millions of test cases in real life scenarios, it would take time but still a good
code though.
boo golfing, make your code easier to read
This comment is hidden because it contains spoiler information about the solution
Ohhhh, my bad, english isn't my native language... Don't understand word odd) Thank you much)
This comment is hidden because it contains spoiler information about the solution
damn i have never seen anyone write this like that lol. why dont you just use O(n^2)?
And wouldnt you rather then say that your dictionary one would be O(n+m) with m <= n?
in most cases it is one line statment , != 0 is redundant
and I thought my code would is "hella slow"
This is a great demonstration of how terrible is codewars ranking system.
At least add buttons "Bad Practices" and "Bad Complexity".
What is currently here teaches people bad things and reinforces wrong opinions about code.
Loading more items...