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.
Thank you! I like the logic, it's precise and clear in the same time!
This one is better than the top answer.
Good logic
i agree I think this is the most elegant solution.
This is the least thing you should worry about regarding speed of Python code.
Wouldn't checking the iterable lenght every time make it slower?
It's a great and clever solution, you don't need to add new variables.
You just use the last element of the list.
And you are very intelligent to put in the second order this: item != res[-1]
Because of the lazy evaluation. Only it's evaluated the first bool result if it's a empty list
so you don't need to worry of the second one.
Thank you :)
took me a while to realise how it works. less variable and straighforward too. i like
Thats a good one, using results list to check, nice
this should be top solution
Thank you for your answer!
Have a look there: https://docs.python.org/3/tutorial/introduction.html#lists
Actually, I don't quite understand res[-1]……
great solution, couldn't think of that and learned something new thanks to you.
this is a great solution. Specially the -1 part. I was so caught up, I didn't think about it.
Loading more items...