15
not_real
2 15 30
1022/ 1195
Last seen 1 year ago
Member for 8 years, 9 months, 16 days
Difficulty Normal
Best reviews / Newest reviews
short and clear-StefanPochmann 4
It take me a moment to understand that result += n // arabic * roman means: put in `result` string (`n // arabic`) times the `roman` string More
1-liner: sympy.topological_sort-Phil15 1 1
⛳👍 Liked [topological_sort](https://docs.sympy.org/latest/modules/utilities/iterables.html#sympy.utilities.iterables.topological_sort) More
Simple FIFO stack - .pop(0)-MMM_AAA_NNN 1 1
Improve it using collections.deque, then you could substitute pop(0) by popleft() pop(0) is [quadratic](http://www.checkio.org/mission/letter-queue/publications/veky/python-3/double-ended/share/d1d2a0a6c9a81443d0be2e611f017b4d/#comment-17077) More
First-Trailblazer 1
Good use of [conditional expressions](https://docs.python.org/3/reference/expressions.html#conditional-expressions). More
First-Pouf 1 1
except without type is the root of all evil (= hours finding a bug). More
First-l.szyman10 1
Yo could try to use `collections.defaultdict(set)` to simplify letters = {} for word in word_list: for i, letter in enumerate(word): if letter in letters.keys(): letters[letter] |= set(word[i+1:]) else: More
recursion-mihaild 1
Liked the memoizing decorator [functools.lru_cache](https://docs.python.org/3/library/functools.html) More
Next attempt after 2 month Py learning :-)-Pumba_UA 1
`array[::2]` is the shortcut notation for `[array[i] for i in range(0, len(array), 2)]` More
First-chaitanyamaheshwari 1 1
You could use `elements[-2]` instead of `elements[len(elements)-2]` More
First-anastasia.bizyayeva 1
Try using `max` with the `key` parameter. More
Recursive-vit.aborigen 1 1
You could substitute asking for `w` and `b` to be zero by `w < 0 and b < 0' and return zero More
First-doctornkz 1
If you want a little improvement, seems that `reversed(list)` is more 'pythonic' than `list[::-1]` More
5 lines, recursion-kdim 1
Have you thought in using a while checking for changes in `ch` instead of using recursion? More
Enum-veky 1
🤯 Really elegant use of [enum](https://docs.python.org/3/library/enum.html) More
Recursively-AlexFox 1 1
What is the logic behind `n = len(marbles) ** step` to be the recursion levels ? Shouldn't be `step` the deepness of the recursion and 2 (or `len(marbles)`) the wideness? More
Old-xenohunter 1 1
You could simplify your code: * Using divmod function * Storing words in a list instead of a string and joining it with ' '.join(list_of_words) More
First-aksinghdce 1
Not maintainable. It's unclear what is doing without debugging it. Could improve it by converting vertices2 into a static grid of relative positions ((-1,1), (-1,0), (-1,-1), (0, 1), (0, -1) ... and checking out of boundaries into the for loop. More
First-elgoognojks 1 1
prints are good for debugging, but is better using logging than print, because you can turn it off to WARNING when you got into production environment. Example: logging.basicConfig(level=logging.DEBUG) # WARNING or DEBUG ... logging.debug(the_string_you_want_to_print_when_debugging) More
Second-aya.kanazawa 1
Have you thought in using `split` or slicing instead of `re` to improve legibility. More
Three solutions (86, 96, 99 symbols)-CDG.Axel 1
I liked the reverse choosing detail: (-1) ** r More
1
2 3 4 5 6