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.
IMO you should write whatever matches the idea you have. With time and practice you pick up shorter ways to describe what you have in mind.
Python list comprehension tends to be faster than the equivalent for-loop, but that is probably not the reason why people are choosing to use it.
You are re-implementing some common patterns,
min
andmap
. When you start recognizing them, you might start using the already existing implementations instead.List comprehension combines the functionality of
map
andfilter
, but thefilter
part isn't needed here and the mapping function already exists - that makesmap
the minimal already existing thing that fits the problem.This is how I solved the kata, however I see that others use much more shorter code. Mostly they are returning list comprehension. So my question is about efficiency. Is returning one line list comprehension considered more effective?
that's good enough for me. i'll approve it
I see some kata have extra tests on submission, including randomly generated test cases.
I couldn't find a difference between "Test Cases" and "Sample Test Cases" for the exisiting languages in this kata, and the advice is not to be original.
Should there be a separate set of test that run when you submit?
I'm not sure what the difference between tests cases and sample test cases is supposed to be.