39
Horatiu Crista
Last seen 1 day ago
Member for 2 years, 6 months, 15 days
Difficulty Normal
Python, Python, Python...
Nice use of decorator @property for converting the methods to properties!
More
Nice solution! I needed to use groupby from itertools in order to solve it:
for k, _ in groupby(items):
result.append(k)
More
Nice solution! Good use of groupby Class from module itertools into a list comprehension!
More
Interesting solution, as usual! A lesson for learning the use of with and contextlib.
More
Great! Module operator...
The first reason why you might want to use the module 'operator' in your code is if you need to pass an operator to a function:
def apply(op, x, y):
return op(x, y)
More
Nice use of the Heap queue algorithm module.
More
I like regex a lot.
For your solution, I searched the explanation here (https://regex101.com/):
r'^#+|[^#]#'
1st Alternative r'^#+
r means raw string
^ asserts position at start of a line
'#' matches the character '#'
+ matches the previous token between one and unlimited times, as many times as po
More