Shame I can't jump to your solution to vote it up, not only it's really clever it's much faster than top voted and mine.
To be exact most "clever" solution is 9 (!) times slower than yours.
Hate the way Codewars promotes writing functions in slow wank style as "Clever Best Practices" :/
I'm by no means a Python expert, but in my understanding a tuple is a simpler and cheaper data structure than a list (because a tuple is immutable), and thus probably also faster.
Just ignore it. People are having fun trying to compress as much info as possible into a single line of code.
You know, kind of like "mine is bigger" only here shorter is better.
This comment is hidden because it contains spoiler information about the solution
Shame I can't jump to your solution to vote it up, not only it's really clever it's much faster than top voted and mine.
To be exact most "clever" solution is 9 (!) times slower than yours.
Hate the way Codewars promotes writing functions in slow wank style as "Clever Best Practices" :/
what is the explanation @FedyakinRoman ?
What did he ignore in terms of PEP8?
Fixed for python
spoiler
I'm by no means a Python expert, but in my understanding a tuple is a simpler and cheaper data structure than a list (because a tuple is immutable), and thus probably also faster.
And this was not required in the condition.
There was no range specified. But if there was, then the solution would be different.
Just ignore it. People are having fun trying to compress as much info as possible into a single line of code.
You know, kind of like "mine is bigger" only here shorter is better.