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.
the code form
is an antipattern. instead use
Happy to help! :)
Thank you very much!
That is correct. Because order of multiplication doesn't matter, the product of the sorted numbers is the same as the product of the unsorted.
Would I just multiply all the number together? Thank you!
You don't need to sort the values beforehand and you're not getting the last value sorted anyway (i<x.length-1 should be i<x.length).
Basic tests use this:
['|', 'J', '|', '|'],
['|', '|', '|', 'J'],
['...', '...', '...', '...'];
But actual tests use this ("random"):
['|', '...', '|', '...'],
['...', '...', '|', 'J'],
['...', '...', '...', '...'];
Curled hair is 'J' only.
Trimmed hair ("...") can also occur in the "curled hair", as well as in "chin hair", right?
In my initial solution I didn't expect there will be trimmed hair ("...") present in "curled hair",
but only "J" and "|" since trimmed hair is not included in basic test cases.
Unless i'm missing something I think it's there:
Nice kata. Tnx!
Instructions and Test Cases really should include the requirement of
beard hair having "trimmed chin hair" as well.
Was kind of frustrated when my test failed because of the absence
of specs in the Instructions.
Crystal translation here. Review and accept if everything ok.
Should probably add that any characters other than '|' or 'J' should be mapped to '...'. That really wasn't clear.
This is an antipattern. Just do: