May 6, 2024, 1:54 p.m. |
+ 1 |
for Comment
StefanPochmann: Dictionary version :-) ```python def calkin_wilf(n: int) -> tuple[int, int]: result = {'1': 0, '0': ...
|
April 18, 2024, 7:37 p.m. |
+ 1 |
for Comment
StefanPochmann: Save two chars: ``` [x]+[0]*(x==0) [x,x][x!=0:] ```
|
March 24, 2024, 5:58 p.m. |
+ 1 |
for Comment
StefanPochmann: Another 2-liner :-P ```python beat_previous=lambda D,p=-1,c=0:[[p:=c] [c:=0]for d in D if(c:=c*10+in...
|
Jan. 20, 2024, 2:01 p.m. |
+ 1 |
for Comment
mildm: That is strange to me. You've used heapq for distance between mountains, but you adding 1 so you'll ...
|
Nov. 24, 2023, 2:05 p.m. |
+ 1 |
for Comment
Tapas_Kohad: spent months coding in c, 2 years learning python in free time as a hobby. didn't come to know about...
|
Aug. 26, 2023, 2:18 p.m. |
+ 1 |
for Comment
kudinov.feodor: nice codeblock of walrus expressions
|
June 21, 2023, 8:44 a.m. |
+ 1 |
for Comment
toranzocalderonjs: The function works as follows: 1) Consider **c**, and get the list of every substring not containing...
|
June 21, 2023, 8:44 a.m. |
+ 1 |
for Comment
Tinus_Trotyl: Yeah . . . all right :-)
|
June 17, 2023, 12:04 p.m. |
+ 1 |
for Comment
flowerinapot: Great solution, but the readability has decreased
|
May 31, 2023, 7:15 p.m. |
+ 1 |
for Comment
LuckySmoke: Very interesting, I didn't know negative integers behaved like this with the modulo operator.
|
May 22, 2023, 6:15 a.m. |
+ 1 |
for Comment
LuckySmoke: So refreshing to see a solution without recursion. Recursion makes my brain leak out of my ears
|
May 10, 2023, 8:36 p.m. |
+ 1 |
for Comment
msol294: Pretty! But I think "len" instead of "set" would be better. For instance, 'abcd' and 'acbdaaaaaaaaa'...
|
April 29, 2023, 8:52 p.m. |
+ 1 |
for Comment
zlatabrain: This is very, very beautiful and creative. I like this!!!
|
March 28, 2023, 11:37 a.m. |
+ 1 |
for Comment
CDG.Axel: Btw you can avoid 'tiles.remove' by changing comprehension tiles = sum(tiles, []) row = tiles.index(...
|
March 27, 2023, 8:53 p.m. |
+ 1 |
for Comment
CDG.Axel: Thanks for remembering sum(iterable, start). I forgot it again and wrote this: tiles = [e for line i...
|
March 20, 2023, 12:45 p.m. |
+ 1 |
for Comment
kudinov.feodor: Hi, you suggested pure geometric approach, which is really cool, just wanted to highlight that for m...
|
Jan. 26, 2023, 12:05 p.m. |
+ 1 |
for Comment
Kolia951: Are you using here complex numbers? Wow! How does it work!?
|
June 27, 2022, 10 a.m. |
+ 1 |
for Comment
veky: Lines 7 and 8 can be much more easily written as data.setdefault((user, site), []).append(time) for ...
|
April 15, 2022, 11:55 a.m. |
+ 1 |
for Comment
Mylinear: I scrutinized your solution at https://pythontutor.com/ step by step to understand and after some ti...
|
Feb. 16, 2022, 11:04 a.m. |
+ 1 |
for Comment
CDG.Axel: can't handle myself :) def ugly_number(position: int, red=__import__('functools').reduce) -> int: re...
|
Dec. 3, 2021, 8:37 a.m. |
+ 1 |
for Comment
CDG.Axel: Sad that bitwise operation in python isn't fast ( from time import time n, st_time = 10000000, time(...
|
Nov. 29, 2021, 1:01 p.m. |
+ 1 |
for Comment
Phil15: _, size, split = distance[0] # smallest item without popping it split += 1 heapreplace(distance, (sp...
|
Aug. 12, 2020, 7:15 a.m. |
+ 1 |
for Comment
ibonyun: Wow, very concise. I used basically the same logic but took many more lines to do it. Using `sum()` ...
|
Feb. 7, 2020, 8:40 a.m. |
+ 1 |
for Comment
juestr: Clever, but it doesn't work either since in fact a list _can contain itself_: In [24]: l = [1, 2, 2,...
|
June 12, 2019, 8:26 p.m. |
+ 1 |
for Comment
veky: Ah, distributivity: the cute way to write ' ' * (by + (index < to)) with only one pair of parenthese...
|
June 10, 2019, 7:57 a.m. |
+ 1 |
for Comment
svet: I suppose that 11th line is not necessary because pos is continuously increasing
|
April 12, 2019, 5:17 a.m. |
+ 1 |
for Comment
juestr: Very nice. In the if-branch **dice_number can be removed since it is known to be 1.
|
March 12, 2019, 6:08 a.m. |
+ 1 |
for Comment
Phil15: I would say this is more creative than clear (for merger and last line) but it's great that you do t...
|
Feb. 28, 2019, 7:36 p.m. |
+ 1 |
for Comment
colinmcnicholl: All local asserts including extra run through timeit, 3 repeats, 1000 times you code: [0.00851576969...
|
Feb. 25, 2019, 5:32 a.m. |
+ 1 |
for Comment
mplichta: never ever iterate list like that! it is not pytonic code! Do you like: def checkio(entry): filtered...
|
Jan. 21, 2019, 8:48 p.m. |
+ 1 |
for Comment
fed.kz: Why do not use `lower` after `join` method instead of `map`?
|
Jan. 13, 2019, 10:38 a.m. |
+ 1 |
for Comment
vit.aborigen: Hope you didn’t write that turns manually :)
|
Dec. 5, 2018, 5:34 a.m. |
+ 1 |
for Comment
kirosx88: Why return self.health >= 0 ? seems like warrior still alive when he has 0 hp?
|
Dec. 2, 2018, 7:50 p.m. |
+ 1 |
for Comment
colinmcnicholl: Very good compact and also clear. IMO code would look better if you leave a single space either side...
|
Nov. 22, 2018, 5 a.m. |
+ 1 |
for Comment
fed.kz: You could replace the expression in a line 4: not (y < 20 or y > 40) in another 20 <= y <= 40 On exa...
|
Nov. 21, 2018, 5:23 a.m. |
+ 1 |
for Comment
hrvoje: I love the max(cells, key=your function... approach. My respect, one of the best coders I've seen on...
|
Oct. 20, 2018, 12:08 p.m. |
+ 1 |
for Comment
BrianMcleod: I agree. If floats were used for the corners of the rectangles, this would be much more interesting....
|
Sept. 30, 2018, 2:04 p.m. |
+ 1 |
for Comment
Phil15: I would see pairs like constant here. I like it. And why set(sorted(...)) instead of set(...) ? :-D ...
|
Sept. 30, 2018, 2 p.m. |
+ 1 |
for Comment
Phil15: And if you want it shorter and if you like next. from itertools import combinations tower = lambda c...
|
Sept. 29, 2018, 5:05 p.m. |
+ 1 |
for Comment
natrixaeria: i think doing: "import re;checkio=lambda k:re.findall"... would be even shorter (100)... unless the ...
|
Sept. 26, 2018, 5:34 p.m. |
+ 1 |
for Comment
JamesArruda: I like how you use `neighbors & valid-set(path)`. I may copy that for neighborhood searching.
|
Aug. 3, 2018, 2:14 p.m. |
+ 1 |
for Comment
JimmyCarlos: This is the first solution I've seen that uses the fact that this puzzle is deterministic - eg, it d...
|
July 31, 2018, 7:56 a.m. |
+ 1 |
for Comment
Marlen_Nurmakov: Didn't know of sum(n, []) . But you could make set with set(sum(n, [])) . And this sum([not set(x) &...
|
June 8, 2018, 8:53 a.m. |
+ 1 |
for Comment
quarkov: Solved this task in a similar way.
|
Feb. 4, 2018, 4:14 p.m. |
+ 1 |
for Comment
Alububu: Haha! I'm not the one who wrote most ;)
|
Jan. 4, 2018, 10:11 a.m. |
+ 1 |
for Comment
badbird: if the password is '+++++++++++',it also return True, but it is a wrong answer.
|
Dec. 7, 2017, 6:50 p.m. |
+ 1 |
for Comment
Ylliw: S='!$&) #&(+ %(*- ),.1 +.03 -025 1469 368; 58:= !#$(,013 #%&*.235 )+,0489; +-.26:;= !#%$*,24:9;=' ch...
|
Nov. 23, 2017, 1:46 p.m. |
+ 1 |
for Comment
hanpari: Just few hints: while stack: # is good enough really :) learn more about buit-in enumerate to avoid ...
|
Nov. 22, 2017, 1:53 p.m. |
+ 1 |
for Comment
veky: Last line is simply return not s
|
Nov. 1, 2017, 9 p.m. |
+ 1 |
for Comment
oduvan: cool idea but not very clear. How about creative category?
|
Oct. 31, 2017, 2:52 p.m. |
+ 1 |
for Comment
tomires: Because recursion is for pussies ;]
|
Oct. 19, 2017, 11:24 a.m. |
+ 1 |
for Comment
Vasily__Chibilyaev: The title literally made me cry) welcome to the wonderfull world of coding, mate. Don't want to diss...
|
Sept. 29, 2017, 1:12 p.m. |
+ 1 |
for Comment
oduvan: Just today I was thinking.. maybe we should make one more funny mission? :)
|
Sept. 7, 2017, 3:35 p.m. |
+ 1 |
for Comment
mplichta: impressive and as for one-liner quite readable.
|
Aug. 21, 2017, 7:50 p.m. |
+ 1 |
for Comment
Sim0000: You can write ret=i if (key(i)<=key(ret)) != switch else ret without ^. By the way, python's origina...
|
July 28, 2017, 8:23 p.m. |
+ 1 |
for Comment
StefanPochmann: You could use result += (data[0], data[size]), which is one character shorter and probably slightly ...
|
July 26, 2017, 1:47 p.m. |
+ 1 |
for Comment
StefanPochmann: Still one character longer than [mine](https://py.checkio.org/mission/house-password/publications/St...
|
July 21, 2017, 2:47 p.m. |
+ 1 |
for Comment
veky: Ah, yes. 2502072 is much better than 902. :-D
|
July 17, 2017, 7:36 a.m. |
+ 1 |
for Comment
Sim0000: You can use hasattr(a,'\_\_iter\_\_').
|
April 4, 2017, 6:43 p.m. |
+ 1 |
for Comment
oduvan: You are always choosing name x-liner, and always right :)
|
Feb. 12, 2017, 9:56 a.m. |
+ 1 |
for Comment
suic: Hi, nice one. You can write it like this: ```python verify_anagrams = lambda *a: list.__eq__(*map(f,...
|
Jan. 24, 2017, 6:53 p.m. |
+ 1 |
for Comment
veky: Everything works well untill that monstrous return. Yes, Python doesn't have switch statement, and i...
|
May 11, 2016, 2:45 p.m. |
+ 1 |
for Comment
Blastus: Please try running your code through a PEP8 checker: http://pep8online.com/s/Z1afiJTk Before publish...
|