Aug. 4, 2017, 10:31 p.m. |
+ 1 |
for Comment
Blukano: This solution is clever, but maybe quite inefficient: * it looks in 8 directions when it only needs ...
|
Aug. 4, 2017, 10:23 p.m. |
+ 1 |
for Comment
StefanPochmann: Collecting None, sweet. Or is that just to confuse+educate? :-) `0<=ij>=0` would have been nice as w...
|
Aug. 4, 2017, 10:23 p.m. |
+ 1 |
for Comment
veky: > Collecting None, sweet. Or is that just to confuse+educate? :-) Why "or"? It's "and". :-] Of cours...
|
Aug. 4, 2017, 10:21 p.m. |
+ 1 |
for
Set comprehension-veky
|
Aug. 4, 2017, 10:20 p.m. |
+ 1 |
for Comment
veky: Now you have another use for my code. :-D Of course, I could have solved it with complex numbers, th...
|
Aug. 4, 2017, 10:20 p.m. |
+ 1 |
for Comment
Cjkjvfnby: **{g(p//n+d*k,p%n+e*k)** I usualy produse such text by random typing instead of **lorem ipsum** :)
|
Aug. 4, 2017, 10:19 p.m. |
+ 1 |
for Comment
ljy95135: zip(*matrix), # Vertical Nice way! I learn a lot!
|
Aug. 4, 2017, 10:18 p.m. |
+ 1 |
for Comment
tommy6073: Very clear. I especially liked this last part :) diagonal(m[::-1] for m in matrix))) # Diagonal reve...
|
Aug. 4, 2017, 10:18 p.m. |
+ 1 |
for
First-canassa
|
Aug. 4, 2017, 10:16 p.m. |
+ 1 |
for
Using groupby-nickie
|
Aug. 4, 2017, 10:14 p.m. |
+ 1 |
for Comment
GheorgheIon: The reason I downvoted: import this Obfuscated code is not creative. Is just very hard to read.
|
July 28, 2017, 10:49 p.m. |
+ 1 |
for
rec !-timiway
|
July 28, 2017, 10:47 p.m. |
+ 1 |
for
... half of common LISP-Renelvon
|
July 28, 2017, 10:47 p.m. |
+ 1 |
for Comment
lsdda: I like the title. Good solution!
|
July 28, 2017, 10:46 p.m. |
+ 1 |
for Comment
veky: I know. But as I wrote below, I couldn't resist using + considering the context of the task. ;-)
|
July 28, 2017, 10:45 p.m. |
+ 1 |
for Comment
veky: Thanks. What do you think of "su\x6d"? :-)
|
July 28, 2017, 10:45 p.m. |
+ 1 |
for Comment
nickie: I prefer "mus"[::-1] :-)
|
July 28, 2017, 10:45 p.m. |
+ 1 |
for
Using +-veky
|
July 28, 2017, 10:45 p.m. |
+ 1 |
for
Recursive in two lines-Dodge_545c07bd039b4e1aa1a6dd88
|
July 28, 2017, 10:44 p.m. |
+ 1 |
for
almost dangerous-mreinhardt
|
July 28, 2017, 10:43 p.m. |
+ 1 |
for Comment
Ardillo95: I don't understand the second line of code :/
|
July 28, 2017, 10:42 p.m. |
+ 1 |
for Comment
mreinhardt: Nice one. I did something similar except that I did a check before the eval to make sure unexpected ...
|
July 28, 2017, 10:42 p.m. |
+ 1 |
for Comment
crazyzubr: Interesting. But why not in one line? def checkio(data): return eval('+'.join(map(str, data)))
|
July 28, 2017, 10:38 p.m. |
+ 1 |
for
First-ciel
|
July 22, 2017, 8:12 p.m. |
+ 1 |
for Comment
veky: If I were you, I'd be worried. :-P :-D
|
July 22, 2017, 8:12 p.m. |
+ 1 |
for Comment
LewisFogden: This is the first time I've come up with the same solution as Veky :)
|
July 22, 2017, 8:12 p.m. |
+ 1 |
for Comment
bcristian: I meant another version of that function, which returns the maximum length of any sequence, i.e. goi...
|
July 22, 2017, 8:11 p.m. |
+ 1 |
for Comment
veky: One thing comes to mind: > Especially since what I imagined the function to be is pretty much the sa...
|
July 22, 2017, 7:50 p.m. |
+ 1 |
for Comment
veky: > Which leads to the question - how do you know which way to go? Gut feeling (backed by extensive ex...
|
July 22, 2017, 7:48 p.m. |
+ 1 |
for Comment
veky: Care to timeit? You might get surprised. ;-P I really hate it when people learn something from anoth...
|
July 22, 2017, 7:47 p.m. |
+ 1 |
for Comment
veky: > Although it's not really a big deal, I am curious of how should I use python effectively in compar...
|
July 22, 2017, 7:46 p.m. |
+ 1 |
for
^-veky
|
July 22, 2017, 7:44 p.m. |
+ 1 |
for Comment
Tinus_Trotyl: Way back at the end of the '70’s 6502 assembly code (in haxadecimal format like ‘A9 00’ for load acc...
|
July 20, 2017, 11:21 p.m. |
+ 1 |
for Comment
AlexGiesbrecht: Wanted to do it via dictionary, but somehow forgot about .values() ...
|
July 20, 2017, 11:20 p.m. |
+ 1 |
for Comment
veky: IDLE reports error if you try to "return" while outside of a function. You must define a function an...
|
July 20, 2017, 11:20 p.m. |
+ 1 |
for Comment
MariuszWilk: Great solution :) I'm new to this. Can you explain where the "True" value comes from (when the input...
|
July 20, 2017, 11:20 p.m. |
+ 1 |
for Comment
cellsuicide: Note that he set stack to have one element, an empty string, at the beginning. Checking for equality...
|
July 20, 2017, 11:14 p.m. |
+ 1 |
for
replace-Sim0000
|
July 20, 2017, 11:14 p.m. |
+ 1 |
for Comment
apotokin: I would rather not agree with you. This seems 'dirty hack' for me. String operations are costly... Y...
|
July 20, 2017, 11:13 p.m. |
+ 1 |
for Comment
apotokin: line s = s.replace('{}', '').replace('()', '').replace('[]', '') has to produce three different stri...
|
July 20, 2017, 11:13 p.m. |
+ 1 |
for Comment
apotokin: It seems like a lot of memory consumed since string type is inmutable and each iteration has to crea...
|
July 20, 2017, 11:12 p.m. |
+ 2 |
for
Fast brackets-hanpari
|
July 20, 2017, 11:11 p.m. |
+ 1 |
for Comment
DerryK: Nice use of sentinel at the bottom of the stack. A very minor suggestion: You could replace the last...
|
July 20, 2017, 11:11 p.m. |
+ 1 |
for Comment
PyPoet: That's cool and I do believe that it's actually speedy. I like how you exploit the 'last in - first ...
|
July 20, 2017, 11 p.m. |
+ 1 |
for Comment
ignalion: 1. More than one pass through the expr 1. Hardcoded brackets 1. Replace method on a string is very i...
|
July 20, 2017, 11 p.m. |
+ 1 |
for
First-Avaris
|
July 19, 2017, 11:07 p.m. |
+ 1 |
for Comment
mlb00: This is a nice solution but PEP 8 should be encouraged, especially since this site is to promote cod...
|
July 19, 2017, 11:06 p.m. |
+ 1 |
for Comment
Peter.White: chr(ord(pawn[0])-1)+str(int(pawn[1])-1) What is so hard to understand there? Those are buil-in funct...
|
July 19, 2017, 11:06 p.m. |
+ 1 |
for Comment
maurice.makaay: This does not deserve the category _Clear_ IMO. This kind of logic: chr(ord(pawn[0])-1)+str(int(pawn...
|
July 19, 2017, 11:05 p.m. |
+ 1 |
for Comment
Cjkjvfnby: It is simple and clear, but bad formated. Long string make it hard to read.
|
July 19, 2017, 11:05 p.m. |
+ 1 |
for
First-Kerulen
|
July 19, 2017, 10:59 p.m. |
+ 1 |
for Comment
veky: Well, I get headaches from reading _your_ solutions, so we're even. :-P Let me tell you a secret: I ...
|
July 19, 2017, 10:59 p.m. |
+ 1 |
for Comment
Peter.White: How do you not get headaches when writing something like this? I get them just from _reading_ it. ;)
|
July 19, 2017, 10:59 p.m. |
+ 1 |
for
o, safe pawns...-veky
|
July 19, 2017, 10:59 p.m. |
+ 1 |
for Comment
DiZ: This is what I wrote after seeing your solution - and hoping set comprehension would be shorter than...
|
July 19, 2017, 10:59 p.m. |
+ 1 |
for Comment
veky: Funny, this is exactly the same length: safe_pawns=lambda p:sum(bool({chr(ord(c)+o)+chr(ord(r)-1)for...
|
July 19, 2017, 10:57 p.m. |
+ 1 |
for
Sum of chr-DiZ
|
July 19, 2017, 10:57 p.m. |
+ 1 |
for
Straightforward ... :)-hrvoje
|
July 17, 2017, 11:45 p.m. |
+ 1 |
for
First-DanielDou
|
July 17, 2017, 11:43 p.m. |
+ 1 |
for Comment
veky: Really? A reason for -3? Unreadable? Not even a mention that it actually has a bug (down in the comm...
|
July 17, 2017, 11:43 p.m. |
+ 1 |
for Comment
JackSchneider: look briljant but is unreadable. If one of my employees did this to me he must look for an other job...
|
July 17, 2017, 11:41 p.m. |
+ 1 |
for Comment
hrvoje: I'll try. First, he creates an iterator by mapping int to a string. (list added just for show): In [...
|
July 17, 2017, 11:38 p.m. |
+ 1 |
for Comment
s_prapat: I love it. :) Bending my mind. Normally I code straight to make it easy to be understood by others. ...
|
July 17, 2017, 11:37 p.m. |
+ 1 |
for
Slicy-misterjmf
|
July 17, 2017, 11:34 p.m. |
+ 2 |
for
First-MadHatter
|
July 16, 2017, 8:55 p.m. |
+ 2 |
for
Using `filter`-BertrandBordage
|
July 16, 2017, 8:54 p.m. |
+ 1 |
for Comment
veky: Your comment is too. :-) Seriously, do you _want_ to understand it? That can probably be arranged.
|
July 16, 2017, 8:52 p.m. |
+ 1 |
for Comment
smjefferson602: A question if you choose to accept it: My first solution to Monkey Typing looked like the code below...
|
July 16, 2017, 8:52 p.m. |
+ 1 |
for Comment
veky: First, when you write code block in comment, indent it by 4 spaces. This is really hard to read. You...
|
July 16, 2017, 8:52 p.m. |
+ 1 |
for
Obvious-veky
|
July 16, 2017, 8:50 p.m. |
+ 1 |
for Comment
dan.garthwaite: I would prefer to remove it outside the loop - so that it isn't being executed over and over.
|
July 16, 2017, 8:48 p.m. |
+ 1 |
for Comment
Sim0000: Of course, above code is just for DavidJones and I want to discard generator function from original ...
|
July 16, 2017, 8:48 p.m. |
+ 1 |
for Comment
veky: And this is even more "decrypted" (just to show how wrong that word is;) version: def count_words(*a...
|
July 16, 2017, 8:47 p.m. |
+ 1 |
for Comment
Sim0000: This is decrypted version. def count_words(text, words): text = text.lower() count = 0 for w in word...
|
July 16, 2017, 8:46 p.m. |
+ 1 |
for Comment
veky: It's not _just_ you. But it's nice to know it's not _just_ me you have a problem with. ;-) A more im...
|
July 16, 2017, 8:46 p.m. |
+ 1 |
for Comment
DavidJones: Is it just me, or should this NOT be the "clear" solution. As a newcomer, it's extremely discouragin...
|
July 16, 2017, 8:45 p.m. |
+ 1 |
for Comment
marshall.zheng: nice! came to know sum of boolean
|
July 16, 2017, 8:43 p.m. |
+ 1 |
for Comment
veky: "Clever compiler" would have to be _much_ more clever than you think. It's perfectly possible that "...
|
July 16, 2017, 8:39 p.m. |
+ 1 |
for Comment
veky: Mathematically: `bool`s are _saturated_. Once a `bool` is True, it cannot become "truer", and that's...
|
July 16, 2017, 8:36 p.m. |
+ 1 |
for
First-Sim0000
|
July 16, 2017, 8:36 p.m. |
+ 1 |
for Comment
veky: Here's the meta-recipe: just do what Veky does. :-P
|
July 16, 2017, 8:36 p.m. |
+ 1 |
for Comment
nickie: It's funny, though, how the same solution is on the top of the list both for "Clear" and "Creative"....
|
July 16, 2017, 8:35 p.m. |
+ 2 |
for
May be the easiest way to solve-yuriy.tsekhovoy
|
July 11, 2017, 11:22 p.m. |
+ 1 |
for
max-count-bryukh
|
July 11, 2017, 11:13 p.m. |
+ 1 |
for Comment
veky: Thank you. :-) I code for almost 30 years now - tried many languages, was good in many of them, but ...
|
July 11, 2017, 11:13 p.m. |
+ 1 |
for Comment
kest_iv: everytime i check your answers my mind == blown! such a creative approach you have. For how long do ...
|
July 11, 2017, 11:12 p.m. |
+ 1 |
for Comment
veky: Beginners don't know many things. And more importantly, _different_ things (Many beginners told me "...
|
July 11, 2017, 11:12 p.m. |
+ 1 |
for Comment
jcook00: solutions like this seem less complex than the longer ones. but, it requires knowing things about th...
|
July 11, 2017, 11:11 p.m. |
+ 1 |
for
First-shiracamus
|
July 11, 2017, 11:10 p.m. |
+ 1 |
for
First-DanielDou
|
July 11, 2017, 11:07 p.m. |
+ 1 |
for Comment
veky: [Yes](https://checkio.org/mission/most-wanted-letter/publications/veky/python-3/1pass/), but it's no...
|
July 11, 2017, 11:07 p.m. |
+ 1 |
for Comment
Flying_Eye: str.count complexity is linear, so complexity of this solution is (123 - 97) * len(t). Can we do bet...
|
July 11, 2017, 11:06 p.m. |
+ 1 |
for Comment
veky: It's not a trick, it's just a syntax feature: . has greater precedence than (), so a.f(x) is not a.(...
|
July 11, 2017, 11:05 p.m. |
+ 1 |
for Comment
mr.floppy: But don't try them for an insomnia cure: they're too short & far too interesting.
|
July 11, 2017, 11:05 p.m. |
+ 1 |
for Comment
veky: LOL. This is one of reasons I like CiO so much: those compliments I get here, that are often also to...
|
July 11, 2017, 11:05 p.m. |
+ 1 |
for Comment
veky: "key" is the key to the explanation. max is not by intrinsic order, but by key. That is, a is max of...
|
July 11, 2017, 11:01 p.m. |
+ 1 |
for Comment
veky: Thanks. As I said many times, the less you write, the less the interpreter has to chow on. And it's ...
|
July 11, 2017, 11 p.m. |
+ 1 |
for Comment
StefanPochmann: Yeah, just a joke. My real solution was exactly the same as yours. I tried to improve it, but failed...
|
July 11, 2017, 11 p.m. |
+ 1 |
for Comment
veky: "kinda" is deceptive. You added characters to the string, not instructions to a program. I know that...
|
July 11, 2017, 11 p.m. |
+ 1 |
for Comment
veky: It just depends on how you define "solution". If you define it just as "passes all tests", you're ri...
|