39
Horatiu Crista
Last seen 1 day ago
Member for 2 years, 7 months, 1 day
Difficulty Normal
Python, Python, Python...
Great solution using numpy! I am ashamed of my solution having 38 lines (also, numpy).
More
Great solution! Definitely, I will study the heapq module because it's very useful.
More
Great solution! For this problem, I didn't think to use isupper, islower, isdigit. I used regex.
More
Great solution! Because I am a fan of regex, I used re.findall('[\D]+[\d]+', password) for the second part.
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
The second part could be replaced by:
re.findall('[\D]+[\d]+', password)
I am a fan of regex. :)
More
Simple and clear! I used re.findall('[\D]+[\d]+', password) for the second part, because I am a fan of regex.
More
Good idea of using enumerate! I converted the zip in set and compared the lengths.
More
Nice solution! For the second condition, I used regex:
re.findall('\d', password)
More