57
veky
22 48 64 Leader of the month
44668/ 53887
Last seen 11 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
Complex numbers for x,y position-JamesArruda 1
Yes, of course complex numbers are a natural representation of 2D. But you can go _much_ further. For example, instead of dirs[dir_idx], you can just use (-1j)**dir_idx. The set of complex numbers is not just 2D vector space, it's also a field. ;-) More
First-bunnychai 1
Bravo, bravo, bravo! Again, tests don't test, and bunny scores! :-D More
Faster, recursive-Juge_Ti 1 1
Recursion is not a good solution here (although it first pops to mind), since as you have seen, there is a lot of copying going around just to save state to possibly return to it later. It _could_ be done without it, but it's much harder and not really worth it IMO. More
Math Import-bdesign 1 1
Builtin pow is actually more **pow**erful than math.pow. :-) More
First-UndeadMonkey 1
numstring is semantically empty, str(number) says the same thing in a clearer way. You could even iterate for digit in map(int, str(number)): You don't need != 0 in line 7: if digit: answer *= digit More
First-michael.kej 1
You don't need to import date. ;-) You can just say timedelta(1). diff is a strange name for what you're really calculating. "in {5, 6}" is probably nicer than "in [5, 6]". Or just > 4. :-) Line 4 is O_O. :-P More
non-sophisticated recursive lambda. -Sillte 1 1
Seriously? Customized Y combinator you consider Clear? .-o More
Complex nums again-ale1ster 1 1
Too many lists and lambdas, but a nice idea. :-) More
First-Sim0000 1 1
Similar to mine but of course much longer. :-] More
First-gyahun_dash 1 1
avoidable(p, q) = all(map(int.__ne__, index(p), index(q))) Many people don't know map can take more than 2 arguments. :-) Also, for spam in (blah for eggs in ham): yoord is really nicer written as: for eggs in ham: spam = blah yoord Also, you can More
~0my3[_p\x7f{-skunkfrukt 1
Yes, that's how a 7bit washing machine embedded microprocessor would solve the problem. :-D Python has a bit richer data structures on your disposal. :-] (Unfortunately, the code for 8 is not valid ASCII... but neither is its complement. Ah, the good old times of punched cards...:) More
O(1)-DiZ 1
If it didn't have so much repetition, you'd get more thumbs. :-) More
Simplified stack solution-bsquare 1 1
Now, isn't that much better? B-) More
Use bad eval to prevent a second type transform-grutte_pier
When you're bad, be truly bad. :-] filter('0'.__ne__, str(number)) Of course, much better is filter(int, str(number)) \- not bad at all. ;-) More
Duh-StefanPochmann 1
Try it on a numpy array. :-P Empty excepts are not ok, not even here. :-] More
6handshakes-blankplank
Line 2 is totally pointless. Lines 15-18 are also pointless. Line 12 is just `fhands |= it`. Lines 10 and 11 can be written in the same way. Lines 6, 13 and 14 can be written using `else` loops. More
Generator-veky
Again, obsession with lists. `merged` is the true solution, line 13 is just bureaucracy. :-) More
Fake Newb!-StefanPochmann 1
Ah. Sneaky. :-P Nice exploit of a security hole of MHSB. :-D More
HUHU-dangyi1115 1
What's the point of having a good solution in the docstring, and then an inferior one in the code? More
Regex and max-kkkkk 1
`max` has a `default` keyword, too, which you can use to avoid lines 5 and 6. Also, re's forward looking might help you so you don't have to extract `group(0)` as a separate operation. More