57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 3 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
Cloud number n in ... e ...-veky 1 1
Thanks @StefanPochmann (do you ever sleep)? More
First-Sim0000 1
Line 8 is the most important one. :-D More
First-UndeadMonkey 1
Don't you think this code duplication is horrible? :-P And even that's inconsistent, since units are handled differently than tens and hundreds. Why tab (== lookup) as a separate argument? It's not that it ever changes. Just use that local variable. Why str(tab[...]) instead of just tab[...]? str More
Simple-Taca 1
You were very close with that "key". ;-) return max(sorted(map), key=map.count) Also, you don't need re. You can just use "abcdefghijklmnopqrstuvwxyz" (also known as string.ascii_lowercase) as first argument to max, and key=text.count as second. But then it's too easy. :-D More
Gaussian elimination-htamas 1 1
Yes, that's it. I wrote the same thing, just compressed. ;-) Now when people ask me to explain my code, I can just show them this. Thank you. :-D One thing puzzles me, though... why fractions? There is no place for them in Z_360. Division is div function anyway, and it raises an exception when it More
start in north-west, go probe-dist south, then go probe-dest east, then find compatible location with probe-dists-jmegner 1 1
Python is not Java. Not every API should be a single method of an ad hoc class. distance could be just a function. And calling it as distance(point1, point2) is more in line with commutativity than point1.distance(point2). (Not quite related, but useful hint: use math.hypot.) Alternatively, Python More
O(1)-veky 1 1
Briefly (but not as briefly as the code, of course:)): extract numbers from matrix, calculate determinant, partially invert it mod 360, multiply cofactor matrix by constant target (divided by 45 for shortness:), quotient by gcd of det and 360, divide, lift the world back to Z_360, and reduce the ans More
all(iterable) == True if iterable is empty-rossras 1 1
Well, what would you expect? FILE_NOT_FOUND? :-D (https://thedailywtf.com/articles/What_Is_Truth_0x3f_) More
PEP8online compliant-veky 1 1
A long time ago, there was a website by Bryukh, that automatically checked PEP8 compliance. I just wanted to show how utterly futile that is, by writing code that completely goes against spirit of PEP8, while being "correct" according to the tool. PEP8 is not meant to be checked automatically! More
Shoooooooooort. :)-hrvoje 1
You could have written just `class checkio` instead of Override. :-) More
First-Sim0000 1
Function extensionality, man. ;-P More
with comprehension-mefka5757 1
Yes, I know I have trained people to use enumerate instead of range(len, but when you say i, _ in enumerate then something's wrong. :-) In this case, you can simply use an even better tool, which is zip. More
try except-Phil15 1 1
Wouldn't it be clearer if you factored that duplication out? More
Sum of chr-DiZ 1 1
Funny, this is exactly the same length: safe_pawns=lambda p:sum(bool({chr(ord(c)+o)+chr(ord(r)-1)for o in(-1,1)}&p)for c,r in p) More
Party Invitations - if the friend does not come to the party, the party has to...-JohanL 1 1
set has .discard method. ;-) BTW interesting title. At least a part of it. :-D More
First-gflegar 1
Too bad you didn't find a closed form solution. ;-) More
The Better Solution-obone 1
"Improvement" depends on the criteria. I surely think that just trying the bases until one works is more intuitive than calculating the maximal digit value --- but of course, the second one is faster. More
split-veky 1 2
To paraphrase Blaise Pascal, "I have made this solution longer than usual, because I lacked the time to make it short". ;-) More
No for loop-tralfamafnord 1 1
... but def loop. :-) Nice. Though you didn't really need another function... checkio could be called recursively. :^) More
First-martin.beseda.3 1 1
I think it was easier to check char by char. :-) More