57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 2 hours ago
Member for 11 years, 6 months, 7 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
First-mlahor 1
It seems really hard to write an O(n^2) algorithm for this mission, but you've managed that. ;-[ More
[15-lines] Timing a single recursive DFS-Phil15 1
It would be an interesting idea to actually use `time.monotonic` for this. :-D 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
Elegant-jiizzyy 1
You have a weird definition of elegant. :-] Sometimes a statement if not text.endswith('.'): text += '.' is better than appending a possibly empty string to text. More
Just math-rossras 1
That loop hardly qualifies as math... you could have used recursion then. 🤓 More
Nested ifs instead of regex-hallux 1
There are other ways besides the regex. 🤓 More
First: translate-leggewie
You meant "Last: translate"? :-D ("First import, then split, then...":) More
Find palindrome for 196-kudinov.feodor
A nice idea, but it really can be solved much more Pythonically. At least you should factor out reversing the number. More
42-alterGNU
I think you have confused The best number ever with The answer to life, universe and everything. :-P More
Mathematical-StefanPochmann 1
> The list of banned words are as follows: sum import for while reduce Yeah, right. :-P More
Nested is faster than flat.-veky 1
Of course, the len checking can be done in the same way, at the expense of blowing up the code by a factor of at least 2. But that's even more wrong than this. :-D More
... unless you're Dutch.-veky
There are some weird things going on here. For example, I thought Python doesn't have a character type (different from str). I bet you thought so too. Yet look at line 20. Calling ord('aa') raises TypeError, calling ord('a') doesn't, but they are of the same type. It seems Guido didn't really mean 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
Second-chaz.ruhl 1
Why + ".*"? Really no reason for that. And of course, "in" works perfectly fine with str. No need to import heavy machinery of re. More
Second-rojeeer
You don't need parens around lambda: lambda is it's own left paren. :-) opt is a weird name (I think you're again calling it by implementation, not by meaning;). `cmp` would probably be better (in Py2 a very similar argument was really called `cmp`). In fact, name `inner` has the same problem. "ex More
Hardest Code I never coded-kranked_354
You might love Python, but you obviously hate me. I see what you're doing, but I don't see what you're trying to accomplish. It's probably so obvious to you that you didn't even consider the possibility your motive wouldn't be understood. Can you articulate your message? Even terrorists make some k More
First-santosh.pagare
Line 9 surely shows some misunderstanding of how Python works. What did you think it does (as opposed to just "return data_new")? And of course, you can just write a list comprehension. return [x for x in data if cnt[x] > 1] More
Striped Words-santosh.pagare 1
This is a perfect example of how deeply unpythonic regexes are. That line 6 seems like it has fallen from some wholly different planet (named Perl, incidentally:). BTW, sum(regex.match(element) and not re.search('\d+', element) for element in re.split('\W+', text.lower())) More
XOR-StefanPochmann 1
I have a feeling I'll like your solutions. :-D More
So Quick!-andrewg12
Great. Now learn about if-else expression. ;-) More