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.
Thank you for the kind words. Take a look at the answer by @mikgra also... it's very good. The anchors are necessary according to the problem description. Without the anchors, a length of "xyz123" would create a zero-length array rather than raising an error. If the kata's tests pass without the anchors, then I would think there must be missing tests.
I would agree. In the instructions, you state that a passing case is "WeIrD StRiNg CaSe" which counts spaces when capitalizing even indices. However, your test case seems to ignore spaces as counting as even indices.
/^\d+$/
Is it essential with these? ^ $
Seems working without those two.
Anyway awesome simple, readable code than mine
?=
is a lookahead assertion. It checks for the match (with any uppercase letter in this case:[A-Z]
) but doesn't include it in the match.Can somebody explain this /(?=[A-Z])/?
try to make it DRY
I'm getting this as well... And no I'm not actually calculating factorials. Figure it out?
I translated this kata into Java, add it if you are interested :)
I think i made a good solution, but it keeps throwing this :(
Process was terminated. It took longer than 6000ms to complete
awesome solution
awesome solution
I think your comment has a little problem too ;). What's the problem in the kata? Also check whether the problem has already been covered by other users.
I think your test case has a little problem
Can you show or modify the test case after i submit the code?
suppose you have used assert method, this only shows
'Value is not what was expected'
I want to see the failed input! like this.
'Expected: "invalid11", instead got: "invalid"'