44
gyahun_dash
13 34 48
14278/ 15612
Last seen 5 months ago
Member for 10 years, 3 months, 4 days
Difficulty Normal
Best reviews / Newest reviews
Second-gyahun_dash
Reversed version [here](http://www.checkio.org/mission/robot-sort/publications/gyahun_dash/python-3/third/). More
Regex-spoty 1
RD = re.match(r'(.+?)(.+?)\2{2,}\1*', str(n/Decimal(d))) '\1' is not needed. More
First-jueli62
return sorted(numbers_array,key=lambda x: abs(x)) You can skip lambda: return sorted(numbers_array,key=abs) More
itertools-gyahun_dash 1
line 13 needs to be modified. I'll do it later. More
flood fill-gyahun_dash
X....XXX X....XXX X....XXX X....XXX X....XXX X......X X......X X......X X......X XXX....X First, we find riverside: riverside = set(getflow(erode(river) - river)) # one side S....XXX # S: riverside S....XXX S....XXX S....XXX S....XXX More
Third-gyahun_dash
# 2799360 = 5! * ((3!) ** 6) // 2 More
bisect-gyahun_dash
Inspired by [ryosms's](http://www.checkio.org/mission/roman-numerals/publications/ryosms/python-3/first/). Thank you. More
First-crazyzubr 1
def iter_row(): for i in range(-1, 2): yield i Is iter_row() equivalent to range(-1, 2) ? If so, you may declare a variable instead: rows = range(-1, 2) More
numpy.less-less-gyahun_dash
if numpy.less exists ([here](https://py.checkio.org/mission/short-string-conversion/publications/gyahun_dash/python-3/second/)) More
combinations-gyahun_dash
inspired by [Sim0000’s solution](https://py.checkio.org/mission/largest-histogram/publications/Sim0000/python-3/first/). More
Counter-gyahun_dash 1
Single cells are not linked with any other cells: stats[cell] == 0. So to delete them: cells &= set(stats) #### About stats: if stats[b] == 4, colony may be healthy. 0, 1, 0, 1, b, 1, 0, 1, 0, elif stats[b] == 3, colony containing b is not healthy. 0, 1, 0, 1, b, 1, More
memoized branch and bound-gyahun_dash 1
Benchmark (on my desktop PC): price, denoms -> answer name answer time[s] ... 123456 [1, 6, 7, 456, 678] -> 187 (appeared in test) gyahund 187 0.000000 lezeroq 187 0.187200 PioterM 187 0.280801 10249 [52, 64, 71, 101, 137, 217, 365, 502, 503, 51 More
group-sequence-gyahun_dash
Solution by generating group-sequence: food | 1 | 2 3 4 | 5 6 7 8 9 10 | 11 12 ... sated(in func) | 0 | 0 1 2 | 0 1 2 3 4 5 | 0 1 ... sated pigeons | 1 | 1 2 3 | 3 3 3 4 5 6 | 6 6 ... More
Second-gyahun_dash
string = '(x1,y1),(x2,y2),(x3,y3)' xsys = [[x1, x2, x3], [y1, y2, y3]] dxdy = [[x2 - x3, x3 - x1, x1 - x2], [y2 - y3, y3 - y1, y1 - y2]] More
First-gyahun_dash
[revised](http://www.checkio.org/mission/the-square-chest/publications/gyahun_dash/python-3/5th/) More
First-samitchell 1
tens=(floor(number/10))%10 is equivalent to: tens = (number // 10) % 10 More
First-Blukano
neighbors="" for r in range(rowstart, rowend + 1): for c in range(colstart, colend + 1): neighbors += str(grid[r][c]) result = neighbors.count("1") You don't need to convert int to str: neighbors = [] for r in range(rowstart, rowend + 1): for c in ra More
First-JeffReymond
for i in range(2 ** len(data)): s = "{:0{size}b}".format(i, size=len(data)) sides = [int(x) for x in s] If you import itertools, you can use **product**: for sides in product((0, 1), repeat = len(data)): More
stack-blabaster 1
adjacent = [set() for _ in range(i)] How about **collections.defaultdict**? adjacent = defaultdict(set) More
Recursive solution-big312
if "1" in chemin and "2" in chemin and ... You can check **chemin** using **set**: if len(set(chemin)) == 8 and chemin[-1] == "1": ---- teleports_map = [(int(x), int(y)) for x, y in teleports_string.split(",")] You don't need to convert strings to **int**: teleports_map = telepo More
1 2 3
4
5