57
veky
22 48 64 Leader of the month
44584/ 53887
Last seen 18 hours ago
Member for 11 years, 6 months, 6 days
Difficulty Advanced
We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.

Best reviews / Newest reviews
Short-Nep
Short? It's about thrice longer than necessary. ;-P More
One Liner-nrsaty
I'm not quite sure what are you trying to accomplish. You practically torture Python with your horrible pile of symbols, as if you try to golf, but on the other hand, you miss so many obvious optimizations in that regard. (No, I'm not talking about my `-s%10`.:) For example, (lambda d: abominat More
If, if, and if-Cya
Nice (though could be simpler, of course), but the asymmetry between handling hour and minute (oops, time[1]:) is kinda odd. I think better would be hour, minute = map(int, time.split(':', 1)) More
meh-Leonix
Nice regex formation. :-D But seriously, some other things might be improved a lot. String methods, especially .isupper and .endswith, should be considered. More
Second-mlahor 1
Yes, O(n) is nice. And of course, if the answer is True, then it's the best you can do. The question is, can you do better if the answer is False? :-] More
Third-mlahor 1
Yeah, that's ok - if the argument is really a list (or any sequence). But imagine someone asks d = {2: 8, 6: 5, 4: 8} all_the_same(d.values()) where you can iterate through the argument, but there is no `...[0]` operation. Can you still have the same complexity? :-) More
% and //, no binary conversion!-Sioul 1
You're still converting to binary, only you're doing it yourself instead of having Python do it. :-) More
while chunk yield chunk-veky
If you're wondering how people wrote that pattern before walrus, check out my other solution. ;-) More
Just math-rossras 1
That loop hardly qualifies as math... you could have used recursion then. 🤓 More
very clear lambdas-fishsouprecipe 1
It can be even clearer [without them](https://py.checkio.org/mission/boolean-algebra/publications/veky/python-3/an-operator-by-any-other-name/). :-] More
Solution for float input numbers-archius11
This is a beautiful algorithm. Too bad it's written in Java, not Python. :-P :-D More
Nested ifs instead of regex-hallux 1
There are other ways besides the regex. 🤓 More
Chuck Norris Constant-r.bathoorn
Instead of +1, you could have used the second argument of sum. And instead of that ord business, you could have just sum the bytes. ;-) [See the "Happy New Year" thread on the Forum for details.] More
Mathematical-StefanPochmann 1
> The list of banned words are as follows: sum import for while reduce Yeah, right. :-P More
Cloud number... -veky
Are the clouds numbered starting from 0? Or 1? :-D More
First (breadth-first-search)-lisovsky
Ah, yes, the "sugrically removed recursion" solution. :-D But still, it's nice that you converted it to BFS (queue) instead of the obvious DFS (stack) one. (Not more than 3+ because you're too anxious about types. In a duck-typed language, it is mostly just nuisance.) More
Half-veky
> The shorter your code, the more remarkable you are. Then I am https://remarkable.com/ :-D More
yield from-DiZ
`yield from` with a genexp is almost as bad as map with a lambda. It has its uses, but these do not include this one. Just use a loop. for g in gen_die(length - 1, remain - i, i): yield g + [i] And stop case for recursion can probably be pushed one less level, to if not length: yield [] More
First-b-612
What do you think line 9 is doing? (True answer is: nothing.) Lines 10~18: From Zen, *Flat is better than nested.* You still have condition duplication, it's just that code is harder to read. More