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
Second-natsuki 1
I made my solution "second" based on your solution. line 26: http://www.checkio.org/forum/post/1618/proper-way-to-check-if-sequence-is-empty/ Converting cells form set to frozenset will give you advantage to make check\_list a set and replace line 47-48 with **check\_list.add((new\_cells, new_ More
second-Cjkjvfnby
This solution passes test suggested by [natsuki](http://www.checkio.org/mission/minesweeper/publications/natsuki/python-3/second/#comment-outer-10252) I update check_solution section with **print\_map** to have visible representation of fail. More
Very well working-Eldin
Are you really need variable **cell** and **mine**? Why not just return? You choose randomly from list, convert result to list with one element and take first value, Why so complicated? More
First-Ana_Pana
No need to set w1: python docs: Note, the non-operator versions of union(), intersection(), difference(), and symmetric_difference() will accept any iterable as an argument. More
First-Sim0000 1
It is bad pattern to recreate string with string concatenation (line 26) On each cycle you make a copy of full string. More
First-Amachua
**t.find(w, start)** is O(n), better not to call it twice. you can remove **key=itemgetter(0),** in line 42, default key do the same. More
First-Amachua
[Efficient String Concatenation in Python](http://skymind.com/~ocrow/python_string/) More
First-bukebuer 2
It is hard to read your code. [Efficient String Concatenation in Python](http://skymind.com/~ocrow/python_string/) More
Straightforward-nickie 1
If you calculate value a lot of time, you should store it to variable. # for word in words.split(): # while True: # p = text.lower().find(word.lower(), p+1) # copy text M times text_for_search = text.lower() for word in words.lower().split(): w More
First-foota
You store number of steps twice, in **queue** and in **d**. You can drop line 20, condition never be True. Same with second condition in line 24. BFS guaranty it. More
Dijkstra-veky 1
**D** for Dijkstra? Why not BFS? More
First-Eldin 1
This code is not good, you can use **continue** instead of **raise**: except notGood: pass More
First-Hanna_Hofman
**You dont need lambda 1**: just call you code in place **You dont need lambda 2** push = stack.appned More
First-salty
You not need first list, map return list. You can convert all values to strings def checkio(G): lines = G + [G[0][a] + G[1][a] + G[2][a] for a in [0, 1, 2]] + [G[0][0] + G[1][1] + G[2][2]] + [G[0][2] + G[1][1] + G[2][0]] return 'X' if 'X' * 3 in lines else 'O' if 'O' * 3 in lines els More
XOR count-bryukh -1 1
PEP257: The docstring is a phrase ending in a period. More
First-mkandacio -1 1
**return bin(number).count(1)** More
1 2 3 4 5 6 7 8 9 10 11 12 13 14
15