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.
I know codewars doesn't use it but in Python 3.x,
map()
returns a map object (iterator) instead of a list object so uselist()
to convert the type.Ah, sorry. I completely forgot. I can't figure out how to do it from my phone, but I'll make a mental note to do it when I get back to my PC later.
EDIT: Apparently, no, I cannot. So I guess that answers your question.
I hope the authors of this code realize that an in-place sorting takes place, i.e. xs changes.
Using test.assert_equals now, thanks.
My first attempt was accepted by the test cases despite being horribly wrong in multiple ways. Like SagePtr said, the test cases are broken. Simply returning True passes them all straight away. Using test.assert_equals would be better.
Great solution!