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.
This is fast for smaller inputs, but .count gets extremly expensive in more repative and longer inputs. Still valid and fast for small inputs :)
Great! I kind of did the same with a few changes.
Mine is faster )))
I literally have this much to learn.....
enumerate creates a pair index, value for each element in the list/array passed in. That's how he's incrementing p, by adding the index to it each time rather than actually incrementing it by 1 in each iteration. I honestly wished I would have thought of this.
Pretty concise
i am literally mind-blown right now.
Don't worry about it. I solved this problem in two ways. First, classically, as I would do in a structured programming language, for example in Delphi - using a for loop and a condition. And then, for my own pleasure, in one line. Of course, it's better not to do this in real problems)
Very cool!
The visualizer only executes the first line of the code...
AMAZING!!! I don't know how people are able to think this way.
You're asking programmers to not explain why bad code is bad.
Coding requires humility. I figure my code will have to be fixed by someone else.
I initially thoght of this solution, but used the count method of a list. Yours is better to be honest.
Got basically the same thing. It's good to know heapq but for a simple logical task it's nice to be able to do it with no library, though I admit I was cringing a bit at my own till[till.index(min(till))], an obviously redundant and costly operation.
Loading more items...