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.
While this does pass the tests, if an array is used with no stray value, this will error with an IndexError.
why tf didn't I think of it this way;
thank you for explanation
If it helps, list comprehension is of the form:
Which can be written as:
You can put as many for as you want, and of course you can put list comprehension inside list comprehension:
Which can be written as:
It took me some time to understand which for was done first when I started.
Thank you! I've been looking into this and list comprehension is some great stuff.
It's a list comprehension, with an
if
statement (and an index). A very useful structure, even if it's not easy to grasp at first. Read more here: https://docs.python.org/3/tutorial/datastructures.html#list-comprehensionsCan someone explain or give me a word/phrase to look up so I can understand how all this fits on 1 line instead of 3 seperate lines?
This comment is hidden because it contains spoiler information about the solution
me too :)
All tests pass, time limit execution fails for the reason "Time: 12303ms Passed: 0 Failed: 0".
The 'Atom' editor shows "Running: python (cwd=undefined pid=733). Exited with code=0 in 0.217 seconds."
Does anybody have the best timing for this kata?
I did not find a way to cut down time at all !!!
Thanks!
This is a good kata for effeciency! Nicely done.
Awesome sir just plain awesome lol :) .... Bash is one of the languages I don't know. but this was pretty simple to figure out :) I am one of those nerds that try to learn everything knowing that all I know ultimatly == Nothing
And comparing my work to this, I over complicated yet another simple solution... lol
Loading more items...