39
CDG.Axel
18 36 55 Leader of the month
9398/ 9695
Axel
Last seen 1 month ago
Member for 2 years, 9 months, 4 days
Difficulty Normal
Best reviews / Newest reviews
7 lines-CDG.Axel 1
Slightly optimized solution (5 lines) is in the Creative category. More
YAML. More Types-tssrkt777 1 1
it's possible to make an one-line solution) and some optimization to make this possible: - start from a.replace('\\', '') - for x in filter(None, a.splitlines()): - map(str.strip, x.split(':')) - long if-else construction More
Sun Angle-tssrkt777 1 1
some optimization: - you may first calculate ans, then control sun visibility with one condition like x <= ans <= y - abs(min) looks superfluous More
Geometry Figures-tssrkt777 1 1
Great abstraction and polymorphism using! But for my solution I economize with volume(). I made it non-abstract with 0 result ) More
First-robertabegg 1
You may first join phrases then replace all in once More
4 one-liners with speed test-CDG.Axel 1 1
Btw! It was list with first 2 zeros [0, 0, 1, ...] It's results for lst = list(range(20)) return items == sorted(items) and len(items) == len(set(items)) # 0.75 return all(map(lambda a, b: a < b, items, items[1:])) # 1.31 return all(a < b for a, b in zip(items, items[ More
Compress List-tssrkt777 1 1
An ideas for optimization: - you can compare self with shifted iterable. And take an elements different with shifted - zip maybe useful for this More
Caesar Cipher (decryptor)-tssrkt777 1
you can use this for alpha shift (need no string module and try-except): chr(97 + (ord(s) - 97 + delta) % 26) and next step looks like pack it all to one line ) More
Best Stock-tssrkt777 1 1
Looks like my first solution... Btw max(..., key=...) could help to improve code :) More
First-Phil15 1
Great span find and merging cycle! More
Ascending List-tssrkt777 1 2
good solution! but it isn't speedy ) you may use all + (comprehension + zip or comprehension + range) More
Unix Match. Part 1-tssrkt777 1 1
Are you sure it works for files like "one.two.three.ext" and templates like "name.so*me.ext"? More
Acceptable Password III-tssrkt777 1 1
some optimzation: - count digits in the word - compare it with 0 and length of word - try to use expression like "x < y > z" More
Acceptable Password II-tssrkt777 1 1
Clearness is inconceivable! Btw try to use 'any' for one-line solution More
First-amvasiliev80 1 1
Great! Do you think about itertools.combinations? something about tr1 = sorted(map(f_norm, combinations(coords_1))) More
Acceptable Password IV-tssrkt777 1 1
some optimization for solution - it isn't necessary test for len(password)>9 in cycle, you may test it once in final 'if' - it's possible to use any(map(str.isdigit, password)) instead of num = False + cycle - if 'num==True and let==True' looks worse than 'if num and let' More
Acceptable Password V-tssrkt777 1 1
it's still possible to make one-line solution using hints from previous tasks :) More
Acceptable Password VI-tssrkt777 1 1
You may use hints from previous tasks and sets for unique symbols count to make one-line solution possible :) More
First-alterGNU 1 1
you can replace sorted(data) L=[x for x in sorted(data)] with L = sorted(data), or simply use data.sort() and omit using L More
Morse Clock-tssrkt777 1 1
first you may use this instead of binar_morze(). In addition you may remove 'bm = '.'*(nums[i] - len(bm)) + bm' def binar_morze(n): return f'{1:04b}'.replace('0', '.').replace('1', '-') second you may to parse source data to 6 variables (it is possible in one line) then use f-string t More