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.
JS starting code has an erroneous extra
{
.I'm a UK guy. We use Mr. Not sure what the Wikipedia article was saying with that, but it's not right. Likely the same with the suffixes (though it's so rare to see one, I can't speak to experience with that.) I think it just depends on the situation, the context. A TV channel might drop the dots, a legal document might keep them, etc.
Just giving an example isn't enough. There is some amount of spec below that, but some things are left out--making it an incomplete spec. And making the resulting code kinda brittle, that passes only the tests you've written but it would fail other real-world cases.
I think it's just to show you what counts? Or something? They should just put it in the spec, in my opinion.
I prefer it this way to be extra sure. I doubt it would slow it down much
@fran_Cesco: No, that's not the case, read about integer division.
I believe that the test cases have been luckily tailored to allow this solution. 9 mangos that cost 5 each cost 30 in total. But if you apply the above with 8 mangos costing 5 each you should get the same result (you are not taking advantage of 1 free mango) but instead you get a float which makes no sense because the result should always be a multiple of 5.
prefixes -> [
'Mister', 'Mr.',
'Mr', 'Madame',
'Mrs.', 'Mrs',
'Miss', 'Ms.',
'Ms'
]
suffixes -> [ 'Senior', 'Sr.', 'Sr', 'Junior', 'Jr.', 'Jr' ]
Like "Junior" and "Jr". Must be to a map from what may be translated and the final word and no all the thing together.
If you submmit a pull request this way your partners of the team will say bad things of you...
It's not mentioned anywhere that prefix/suffix checking should be case-insensitive.
Random tests:
It is unclear how the spec
Every element of the returning string should be capitalized
should be interpreted with name parts containing multiple uppercase letters.And in the end, no matter what the expected behaviour is, it should be in the fixed tests to make sure it's tested. Sometimes it does not appear in the random tests.
These two statements in description contradict with each other. It should be "one or more First Name(s)".
Preloaded
prefixes
andsuffixes
are arrays like this:How are we supposed to comprehend this data structure? When I see
Mister
I do not know what it's supposed to map to, unless I refer to the expected result or the description. (Or in other words, these preloaded arrays are pretty useless.)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 comment is hidden because it contains spoiler information about the solution
Easiest way!
People often use them where they shouldn't, unless it's a callback.
But this is more my preference
Loading more items...