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.
Was looking for a way to combine it all together in one line (
or
for me)Forgot you could use the assignment operator that way.
Doesn't seem wise to iterate over the list three times when you only need to do it once.
This comment is hidden because it contains spoiler information about the solution
You need to set name to private to need a getter function for the class.
I don't fully understand this, but thought it was clever not only because I couldn't think of a way to do this without built-in control structures but the use of () extending the way it did syntactically. You are using the fall back value of False==0 / True==1 to index to a function tuple and the
()
somehow executes whichever one was selected.Would this not work for this data set
is_monotone([1,2,3,2])
?You should 'return False' or 'break' from the for loop because your 'answer' won't change after that point.
n + m < 2 will never be True; it will get evaluated, but always be False and move into the default return statement n*m-1.