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.
I came up with a similar solution but did not put the second arguments in quotes. Is there practical difference?
Thanks for explanation ( ͡° ͜ʖ ͡°)s
mine)))
I wanted to do this but couldn't perform a double regex by && || but couldn't think of this, brilliant.
I think the split and map methods are being upvoted because this is an arrays kata.
This is the simplest answer. Don't know why people are upvoting the split and map method.
I have done the same.
Didn't know is possible to specify a range of numbers [0-9] in Regex,
the most clear and simple.
A magic formula. I didn't get it.
Good point, thanks for the suggestion.
"best practice" would be to use the result of count() instead of going through the whole string twice.
For product 0, the output should be "10", because
1 times 0 is zero => "10"
0 times 1 is zero => 01 => "1"
So why is 1 not the expected output, but 10?
You can use zero padding for integers. "001", "0000 0001" and "1" are all the same.
;-)
Glad it helped, the kata is nice!
I've checked out the issue: my validate function call
digitsProduct
instead ofitself
when it performs recursion.Now it's fixed. Many thanks ;-)
Loading more items...