15
Last seen 6 years ago
Member for 9 years, 6 months, 14 days
Difficulty Normal
great for using [short-ciruit evaluation](https://en.wikipedia.org/wiki/Short-circuit_evaluation)!
More
Almost same as my solution.
Though the different part is the `names()` function.
You don't need `reduce()` there.
Just `return set.union(*self.all_connection)` should be fine. :P
More
hmm... nice use of `operator.and_()`.
Though I think this should be published in Creative category.
More
`(r > int(max(s),36)) - 1`
This is really cool.
I didn't come up with this but a ugly solution with `string.printable.index()`.
And using short-circuit evaluation here is also brilliant.
More
Quite functional programming way.
Use the bottom up method.
There's always a list with only one element in the end of the `reduce()`.
The `reduce(integrate, reversed(pyramid)).pop()`
can be changed to `reduce(integrate, reversed(pyramid))[0]`
Although it's almost the same haha.
More
BTW, after Python 3.4, `max()` and `min()` have new keyword argument `default`.
see
The solution can be
`return max(args, default=0) - min(args, default=0)`
without if-else
More
Oh...
Use `set.issubset()` or even just `<=` then we don't need to filter those non-alpha chars.
So smart!
More