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.
it's a generator expression. Instead of creating a list of all elements it creates an iterable object that returns a single element at a time, which sum() can still operate on. You could also add square brackets and it should still work (because both lists and generator objects are iterable) but will use more memory.
This comment is hidden because it contains spoiler information about the solution
Likewise
Why does the init function have only self and data as inputs, but has data and head as assignments in the body?
I get if editing that is part of the kata, but this kata seems focused on the Push and BuildOneTwoThree functions.
Can this kata get a less "girls like diamonds herp" prompt?
Make sure you're set to python 2.7.6, and maybe try refreshing the page? (save your solution just in case)
It's not about the total index, just the index of the number that comes 2nd.
Yes, but time out is at 7000ms, not 2496ms (a reasonable amount of time for this to run, my solution took that long)
Cool, that worked once I made sure it only appended unique items. 2.7s!
Hmm, could it have to do with my list slicing? Not sure how efficient that is. Going to build a list of previous items with append rather than reslicing the whole list each time.
This comment is hidden because it contains spoiler information about the solution
Can you let people know that Python 3 is implemented now? I had no idea why it was asking for parentheses on my print statements. You probably shouldn't default to 3 for people who were already using 2.