Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
you're accepting all characters above ch 48 except 95... Which means you are accepting 69 of ASCIIs 128 characters... There are not 69 alphanumeric characters.
At least the java version has a very lax acceptance test suite.
I suggest adding tests like
there_once_was_a_boy -> t3e_o2e_was_a_boy and 123456 -> 123456
since a lot of regex solutions fail in these cases, even though description clearly states words contain only letters. Clarification of "letters" would also be great! Should the solution work for non-english letters like æbleskiver -> æ8r or is that outside the scope?
In short description might need to be changed to specify "english alphabet letters", and tests that check that only letters are used are missing
the \w includes numbers letters and underscores so no it will think numbers are letters too and even abreviate numbers! 999999 abbreviates to 949! it will also mistakenly take words separated with underscore as being one word.
Regex wordcharacter class includes more than just letters. This solution will make mistakes with words that include underscores or numbers
This solution does not follow the descriptions definition of word. for instance gamma_codex should be abbreviated g3a_c3x.
at the time it had not even gotten any upvotes for clever. I agree some of the 'worse' (performance wise) solutions may be more production friendly, but this is definitely clever. Its good to see more upvotes are comming in for this one
Fair I guess I read it too fast xD
This comment is hidden because it contains spoiler information about the solution
Great golf code, horrible production code
Since groups are always very small, and both 2*n and n is O(n) there is no real reson for that kind of optimization unless you are really hurting for more perfomance.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This solution in difference to a lot here will work even if a passwords spans more than one line. I still would like to see it allow ALL lower letter and upper letter characters not just the english ones, but maybe the guy who wrote the specification was thinking only english too so thats more debatable.
Some of what you say here is wrong, but apparently a lot of people think
^
and$
match string start and end. They match LINE start and endAnyone who accept the above as a valid solution or even worse a "best practise" should think about what happens when someone puts in a multi line password.
Loading more items...