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.
This comment is hidden because it contains spoiler information about the solution
Python doesn't have arrays and the code above isn't creating a list either. It's creating a generator and the creation specifically takes almost no resource, since the values are generated lazily.
AFAIK the difference comes from the code above calling isdigit function a lot of times, whereas replace is only called 10 times. Keep in mind, that both of the functions are highly optimized and written in C, so that's why the the code with more function calls and more python is slower. That also for example causes some O(n^2) algorithms to run faster in python, than an O(n log n) alternative.
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!
great solution
This comment is hidden because it contains spoiler information about the solution
This is so effective, instead of double looping to create 2 lists...
Mutating an argument is the worst thing you can do.
I really like this solution ngl, clever!
This solution is awesome, I feel like a simple amateur. Congrats!
you can't just implement this in O^2 complexity!!!!
CPU go brrrrrrr
Ah that makes perfect sense! Thanks!
This comment is hidden because it contains spoiler information about the solution
Could someone explain why this works? I don't understand. I used the abs() function, but this is so simple and sleek
damn
Loading more items...