21
lezeroq
10 23 44
2602/ 2695
Artyom Koval
Last seen 1 year ago
Member for 11 years, 7 months, 3 days
Difficulty Normal
Best reviews / Newest reviews
sorted-Cjkjvfnby 3 2
Check for iterator stRange class strange: s = 0 i = 0 def __init__(self, n): self.n = n def __iter__(self): self.s += 10 return self def __next__(self): if self.i < self.n: i = self.i More
Based on Fibonacci + RU Comments-pyhappy 1
If this problem was in "Easy go" area, then this solution is most "unusual" of all. More
square programming 8x60-lezeroq 1
Rectangular solution for rectangular world. More
First-kurosawa4434 1 1
Wow. Pretty cool solution. Btw, `lru_cache` default maxsize is 128, if you just increase it a little bit it should work even faster. More
DP-martin_b 1
This solution doesn't work with next ``` assert checkio(4, [5, 3, 1]) == 2 ``` More
Crazy math (crazy complexity O(2^n))-lezeroq
Math solution works well for examples in task and short sequences. It uses long arithmetic with numbers about 10^number_of_brackets, so it has only theoretical concern. More
First-nakanolab 1
Hi, slicing is more "pythonic" than indexing. Instead of sum(a[i] for i in range(max(0, x-1), min(len(a), x+2)) Try: sum(a[max(0, x-1):x+2]) More
First-Natalia_Popova
It doesn't work with `assert sort_by_ext(['...cad', '1.bat', '..cad']) == ['...cad', '..cad', '1.bat']` More
Without dfs-lezeroq
A little explanation for future myself. * Dfs is not required for tests on this website. When dfs starts here, the problem is already solved. However, it's not guaranteed for all possible tasks. * Some parts of code could be deleted here and it would even make algorithm faster on the provided test More
Math magic-lezeroq
Explanation is here http://www.hackersdelight.org/ More
BFS-amon759
For a queue better to use deque from collections instead of list. More
FifoQueue + BFS + nocopy-aureooms
Use "from collections import deque" luke More
if/else effective solution-NEED
Instead of ```len(lst) > 0``` and ```not len(lst)``` pep8 recommends to use ```lst``` and ```not lst``` More