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.
You can also just add the
i
case insensitive flag to your RegExp. Also, you don't need block parameterx
definitely because of no break ;)
I wrote a solution not using matricies (though really, it's doing the same thing if you think about it) that returns in <3s here: https://www.codewars.com/kata/reviews/53f8b3b97f52c27afd0000a7/groups/58f49c5180d86ca3f80005d9
But in general the Matrix way is the way to go
Didn't have to be so specific for this one, compare with mine.
Nice ternary though! 😎
This comment is hidden because it contains spoiler information about the solution
I assume you mean
[a-zA-Z]
and yes that's required to match upper case letters after the symbols.You can't just switch out the . for [a-z], you have to do [a-z||A-Z]
From experience it feels like a 4/5kyu.
Your comment helped me, I wondered why it didn't work for 20 and came to read the comments to see if there was a problem with the test cases, but no it was my own code. Rounding errors on rows 11 and 15.
Take a look at row 11 (
[1, 11, …, 11, 1]
). Compare it to what your outputs.Be careful with floating points!
This comment is hidden because it contains spoiler information about the solution
Depends on the language I guess, but yeah probably.
This comment is hidden because it contains spoiler information about the solution
Took me a while looking through the Array docs to find
product
, I was trying hacky ways withpermutation
before that.This code is better than my own though!
This comment is hidden because it contains spoiler information about the solution
Loading more items...