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.
Thanks for the reply! You reminded me that time complexity does not depend on the number of traversals (i.e. O(n) vs. O(3n)). Seems that for a while I've been torturing myself in writing algorithmns XD
I think there is a need to add description specification for the case where the input is an array of the same numbers.
I personally take that as a "no" even though it fits both ascending and descending sorting definitions.
Your program will return "yes, ascending" for an array of same numbers while I think that should be a "no".
Of course the description should've made it clear.
The program fails the test when n = 0.
Why do people traverse a list twice when traversing it once is enough?
This is my first program in python - hoping to solve my confusion..
This is the greatest solution I have ever seen.