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-axaroth
If you change you checkio a little you can get rid of Pigeon class and use boolean instead. More
First-RRRQ
In compare of xor-bin-count you have much more function calls. Thats why you code works slower. you: 0.24650617428670193 xbc: 0.09194738942302072 http://pastebin.com/v9DRrqfB More
hamming distance-Zophar78 1
**.split('0b')[1].zfill(8)** all this operations does not change number of "1" in text, you can omit them. More
hamming-distance2 1-kloune 1
To iterate on two list of same length use zip: **for val1, val2 in zip(m, n): c += val1 != val2**. If you have lists with different length use zip_lingest from itertools: **zip\_longest(m, n, fillvalue='1')**. More
First-rennerocha
To remove if/else block you can find max len and zfill both values to it. More
First-qumari
Remove commented debug code. PS. Python is very interactive language, you can check code chunks in console. More
First-veil
http://www.checkio.org/forum/post/1618/proper-way-to-check-if-sequence-is-empty/ More
First-gyahun_dash 1
Very bulky and unclear. If you need object that behavior is like list, you can inherit from list. no: **[self.list[0]]** yes: **self.list[:1]** More
First-Cjkjvfnby
forget to remove unused functions :( More
First-RRRQ
Joining all values to p is not good idea, just name them. Like that **x1, y1, x2, y2, x3, y3 = p** Using 26 variables(not unique) in one line is not good idea :) To format str you can use round(float_number, 2) and type **g** instead **.2f**. More
First-plaster
You can simplify you regexpr: re.findall('\d+', "(2,2),(6,2),(2,6)") == ['2', '2', '6', '2', '2', '6'] use **round(val, 2)** and **%g** for string formating More
First-sekine360 1
endswith and cut end can be replaced by .rstrip('.0'). But it is better to do it by specifying type **g** for format. More
First-RRRQ
**max** and **id** are built in python functions don't shadow it. You can simplify this code: ret = 0 ... return ret + 1 You mutate checkio argument. It is not issue but bad practice. Please follow python style guide, don't leave that ugly spaces around function arguments. More
First-ultrajack
**mlen**, **vlist**, **sval**, **ilist** are not good names for variables. Name should be self descriptive. Ithink you can use **set** as datatype for ilist and clist: **sorted(ilist) != sorted(clist)** will be **ilist != clist** **vlist.sort(reverse=1); return [vlist[0][0], vlist[0][1]]** More
Simple-Stork
no: **str.join(",", iterable)** yes: **",".join(iterable)** no need to **str** input More
common words-buddist
**sum** is bad name for varable it is builtin function. More
First-brady.cheng 1
no need **ret_str** just **return ','.join(list_common)** More
First-jcg
I think you can remove **nb\_rows**, **nb\_cols** and use **len()** instead. It will make code more readable. you can use python builtin constants True, false and None instead of literals: **return "M" if we can deduce a mine, return "E" if we can deduce empty cell, return "?" else** if te More
Second-natsuki 2
You have very critical bug in you solution, you use module that you did not import. It is also checkio bug that you solution works. More
First-bukebuer
You can simplify checks: #if field[i][j]==0 or field[i][j]==-1 or field[i][j]==9 if field[i][j] in (0, -1, 9): if 0 <= field[i][j] < 9: More
1 2 3 4 5 6 7 8 9 10 11 12 13
14
15