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
The default sort is ascending. The minus makes the greater numbers smaller, e.g. 10 is greater than 5,
but -10 is less than -5. Minus naturally reverses the order of sort. Got it?
Don't feel bad about your if statement, this solution with an unnecessary dict creation is slower than your if block.
This comment is hidden because it contains spoiler information about the solution
Triangular numbers and algebra
Because your function isn't returning a number as it should.
Python ignores it.
In the following code:
the
-> int
just tells thatf()
returns an integer.More information here PEP 3107
@Steffan: when you mark your post as spoiler, the person to who you answer doesn't get any notification. That's why you see sometimes this kind of message.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution