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.
Gj
beacuse "sum" is reserved name for sum function. and we cant use reserved names if follow PEP8 rules.
why is sum not okay?
O(n) is good, but you can do better
see my solution :)
Maybe that's a C echoing in the authors head :)
I thought the same, but than I tested and noticed that if you input a negative number to the range function, it gives you always a 0. So the code also considers negative numbers
牛逼,学习
negative numbers are not considered in this code
approve
I don't think the parenthesis around the modulos are serving any purpose here. They can be removed
too long, and do not use "sum" for name of variable
Could've compile regex first
nice!!!
since it is used as a variable I think it doesn't pose any problems here. But I still agree that this is not a good practice
after a kata forcing me to learn regex I now start to appreciate it a lot!
"find pattern and do sth with it" vibe that regex methods give seems more readable than other methods (where lil setups scattered around & can be confusing at the beginning uh for a newbie like me)
Loading more items...