31
Cjkjvfnby
10 30 43
5274/ 5695
Andrey Solomatin
Last seen 1 year ago
Member for 11 years, 2 months, 8 days
Difficulty Normal
Best reviews / Newest reviews
First-thuvh 1
no need to cut '0b' # return bin(number)[2:].count('1') More
First-Gennady 1
It is possible implementation of that how sorted handle key argument. More
^-veky 1 2
Congratulation you have fastest solution here (1 from 8) More
First-LexCavalera 1
You can use bool as int: def in_circle(x, y, r): return r > (x ** 2 + y ** 2) ** 0.5 No need to check all corners just top-right(full) and bottom-left(partial), I missed it in my solution too. **sum** is bad name for variable. More
First-idkfa32 1
same code in more functional style def checkio(data): # python 2 head, tail = data[0], data[1:] # python 3 head, *tail = data # return head + (tail and checkio(tail) or 0) More
First-baozhao123 1 1
Please dont use global variables. You use both range and xrange in same cases. You can simplify code: # if land_map[x][y] == 1: # cur_dep += 1 cur_dep += land_map[x][y] # dx = [1, -1, 0, 0] # dy = [0, 0, 1, -1] # for i in range(4): for dx, dy in zip([1, More
Eval()-DoctorProk 1
use string formating it make code more readable: evalstring = '%s%s%s(%s)' % ("s", "u", "m", data) More
sorry-oduvan 1
Looks like you never forget to put coma between strings in list :) Python parser joins string automatically. 'A' "B" == 'AB' More
Second-atrioom 1
Just rename function argument no need to add new variable: def checkio(food): #food = number Be consistent use += in both cases newpigs += 1 pig += newpigs # = pig + newpigs **pig** is not good name for **pigs** More
First-janpaweldrugi 1
**stack** is bad name for **deque** object that used as **queue** More
Meh-veky 1
yes, real meh. I can't unsee eighty bucks in you solution. :) Did you realy need **else:**? More
First-Amachua
Python list are not optimized to pop(0) # remove element form begin, you should avoid this in cycles. Replace it with for or reverse list and use pop() # remove element from end. For each line of log you traverse over all other lines in log. It is to complex. You can break on time_delta more the More
Second-kogi
Why you put this to "Speedy" category? More
split-veky 1
Lines sorted by time, no need to sort them again. sorted(log_text.split("\n")) More
First-kogi
Why you put this to "Speedy" category? More
First-Gennady 1
Why you put this to "Speedy" category? More
LMAO-LMAO
you can use builtin function **len** instead of you lambda: **lambda x: len(x)** removing check at line 2-3 will not affect result. More
First-wahyuoi
You should not use \_\_special\_\_ methods. Use == instead \_\_eq\_\_ More
First-cbrunet 1
V and S are bad variable names for python. For multi line docstrings I prefer to start text from second line. More
First-jcg 1
In line 4-5 you made some checks, but same checks will be done in line 7(inside endswith). I did not test it but think that removing lines 4-5 will make you code to work faster. More
1 2 3 4 5
6
7 8 9 10 11 12 13 14 15