Be careful of using O(N squared) in larger arrays.
nice approach (y)
Because I'm lazy
Then why are you using the same solution?
why I don't know '.count()'
How would you overcome that?
Semicolon can be used a separator but it's limited compared to other C-like languages.
I'm reading something about a semicolon being a seperator.
ok, I understand. But I see it in a few solutions, is there any stylistic reason someone would do that? Or is that a behavior that happens in other languages and is unneccesary in python but could be done if someone was inclined?
No reason at all. Someone submitted it first and all solutions without it got grouped with that solution.
why the semi colon? I'm a beginner
This comment is hidden because it contains spoiler information about the solution
You have a good point there, indeed.
I would measure it against a simple if index is even .. else loop, but that's probably not any faster. Thanks for the heads up!
if index is even .. else