You are right and the random inputs you see are a result of a sloppy authoring, which was unfortunately very common long time ago. The description should define what a "word" is, or tests should use some intuitive, non-surprising interpretation. One hint can be the rank of the kata, where a 7 kyu task would usually not require you to handle any complex cases, but it's a bit of handwaving the problem away.
Call me pedantic but a random list of characters is not what i would call A WORD.
But what really gripes me is that your rules for deciding what a "word" is are never defined.
For example, in one of your tests "Let's" is defined as a whole word and even though the 's' sits after an apostrophe, the test does not qualify this as a single letter word. That seems fair to me.
But in your random tests I was given apprently this phrase.
Now my code provided 3 but the expected result was 1...
So I'm left with only 2 assumptions...
Either the phrase "hy'c'jaX6fU ixFBC'" wants me to see the 'c' as a single letter word
OR
the phrase "8MT2g" is actually two words "MT" and "g"...
Both conclusions actually contradicts another test: "1Ay4Ke5MsW'Ib" which wants a result of 13!
Meaning that both numbers and apostrophes count towards a word size!
This is doing my head in.. Can someone smarter than me please tell me why I'm losing the plot here?
Thank you for the validation!
I managed to wrangle my way around it by discovering the %g character class in lua but for a good hour there I was pulling out my hair...
You are right and the random inputs you see are a result of a sloppy authoring, which was unfortunately very common long time ago. The description should define what a "word" is, or tests should use some intuitive, non-surprising interpretation. One hint can be the rank of the kata, where a 7 kyu task would usually not require you to handle any complex cases, but it's a bit of handwaving the problem away.
Call me pedantic but a random list of characters is not what i would call A WORD.
But what really gripes me is that your rules for deciding what a "word" is are never defined.
For example, in one of your tests "Let's" is defined as a whole word and even though the 's' sits after an apostrophe, the test does not qualify this as a single letter word. That seems fair to me.
But in your random tests I was given apprently this phrase.
"eQnsghc' xN378hr43hHv1kz O5xF2TuTF 9xN8uJWxQeeH hy'c'jaX6fU ixFBC' 8MT2g '6cdNKKKJwK2Ws9 LVu k4UkP 6sgnrftSHF ba6Xu83mHF6m PWD GcXMUC8Kr1n8GZ qfGknKV4Zcq 1MwvcXRz1e7 V87dPg FKdz7y BW61E7N9 "
Now my code provided 3 but the expected result was 1...
So I'm left with only 2 assumptions...
Either the phrase "hy'c'jaX6fU ixFBC'" wants me to see the 'c' as a single letter word
OR
the phrase "8MT2g" is actually two words "MT" and "g"...
Both conclusions actually contradicts another test:
"1Ay4Ke5MsW'Ib"
which wants a result of 13!Meaning that both numbers and apostrophes count towards a word size!
This is doing my head in.. Can someone smarter than me please tell me why I'm losing the plot here?
Perl translation
Perl translation
This comment is hidden because it contains spoiler information about the solution
Perl translation
This comment is hidden because it contains spoiler information about the solution
NOTE: There seems to be a problem with the test environment or test file (e.g., Test.php has a syntax error),
Approved by someone
Perl translation
Loading more items...