57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 15 hours ago
Member for 11 years, 6 months, 24 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
When complex numbers makes things simplier-Ylliw
Complex is better than complicated. More
Mathematical solution-kkkkk
What do you think those int calls do? (Hint: nothing.;) More
Nested ifs instead of regex-hallux 1
There are other ways besides the regex. 🤓 More
match & munch-veky
A cool and very hard exercise: what is the maximum recursion depth this solution can have, given the preconditions of the task? :-> More
Breaking every rule-veky
Still it came out pretty clean, I'd say. :-]] More
Heap to find the median-BigDaiTJ
You know that this isn't really speedy? nlogn, same as sorting. More
Obvious-veky
First we take Manhattan. Then we take whichever is smaller of East Berlin and West Berlin... 🤣🤣 More
Stars aligned-veky 1
`else: return r`s misaligned. ;-D More
Cloud number... -veky
Are the clouds numbered starting from 0? Or 1? :-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
First-Fedorovich
You can chain comparisons. if number % 3 == number % 5 == 0: Nice to know but not really needed: you can use not % without parentheses (as opposed to C). if not number % 3: More
First-Fedorovich 1
_Why_ did you think you needed line 2? You Py2 folks are so obsessed with lists, it blows my mind. :-D Also, line 4 is just "if args:". And you don't need () after return. More
First-Fedorovich 1
Ok, but that prints are cluttering your code. It's ok for debugging, but remove them before publishing. More
First-Fedorovich 1
Line 10 is really interesting. Remember, "special cases aren't special enough". What could "".join([]) do, except give empty string? Why do you think it's a special case? Line 7: of course, there is .isupper(). But if you really need "ABCDEFGHIJKLMNOPQRSTUVWXYZ", you can use string.ascii_uppercase More
First-Fedorovich 1
Line 4 should be removed, and once you remove it, you see that you don't need line 3 either. Just say for word in words.split(): (don't you think "word" is nicer name than "item", for something that iterates through "words"?:) "!= True": ugly. Python has a "not" keyword. Or you can reverse lo More
A*-PositronicLlama
https://www.youtube.com/watch?v=o9pEzgHorH0 There is really no reason for a class here. 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
simple-petrch 1
"<=1" is a cute and completely unnecessary "optimization", that's really hard to grasp at first. You could just say "if not args" in line 2 (or "if args" and reverse returns). In newer Pythons, you can also put default kwarg in min and max, eliminating the need for if totally. BTW you don't need * More
step by step-petrch 1
That "print( c )" wasn't very helpful, right? :-) In fact, your steps can be much more pythonic. b = words.split() c = ("10"[x.isnumeric()] for x in b) d = "".join(c) return "1"*3 in d Whenever you're mapping lambda, you should use a generator. map(lambda arg: expr, seq) ~~> More