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.
You can just create a variable called count which increases by 1 everytime a number is a divisor. This way, you don't have to create an extra list and it's probably faster.
Also, comments are marked with a single #, the second # is unnecessary.
How i started vs how its going
This poor 8 kyu soul got five downvotes for asking an honest question. It's not like they were snide, cruel, or rude; but trying to learn. I just don't get that.
i
is not awailable on this stage.smallest = arr[0]
can be usedAside from setting smallest to be an int, you could also give it the default value "None".
that code works only with py2
just
O(n)
, like it should be. The complexity has nothing to do with that solution being actually... "not very good" (cough).What in the name of time-complexity happens here
That's a problem
In the first run, the comparing part
smallest<arr[i]
will raiseTypeError: '<' not supported between instances of 'list' and 'int'
exception.How did your code even run?