This comment is hidden because it contains spoiler information about the solution
I dont understand this solution. Can you explain it to me sir? I would like to learn that
Don't worry, everyone think that at first.
Apologies. I thought discussions of individual solutions would only be readable by people looking at that solution... and therefore couldn't really be spoilers. Sorry, it won't happen again.
I'm innocent sir, it's him I swear.
I hadn't considered the fact that they have a global scope (my bad). From a speed perspective, that means this is probably as fast you'll get it. Nice.
Assuming a 32 bit integer, that entire list uses only about 13Mb - which sounds like a pretty good trade-off.
They are computed only once.
Brilliant solution!! The initial statements for initialising and management of cases is really good. Congrats
Added in the description ;-)
That's what happens when you copy-paste :P
seems you forgot something somewhere ;)
Random Test - no blacklist
Should score randomly shuffled strings correctly
Unexpected exception raised
Traceback (most recent call last):
File "/runner/frameworks/python/cw-2.py", line 83, in wrapper
File "main.py", line 116, in fourTypePasswords
expected = _calculate_password_strength(password)
File "main.py", line 27, in _calculate_password_strength
strength = sum(value > 0 for value in get_char_type_count(password).values())
NameError: name 'get_char_type_count' is not defined
and same for the next batch of tests
this part is still to "fix", actually. ;)
I finally realised what your list-generated solution was demonstrating. I've added a fully random string generator, with no predefined expected outputs.