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.
What if you got input like tHe-caMEL-Case
You can also just add the
i
case insensitive flag to your RegExp. Also, you don't need block parameterx
I wanted this hahahha but couldn't make it. I got stuck on how to reference. tried gsub(/regex/, '\1'.capitalize). no success and no succes when passed as block.
Hi guys,
When I run this code, I get a TypeError exception:bad operand type for abs(): 'generator'
Is this to do with Python 3+?
Very nice
This is by far the most readable and clear solution
@DaltheCow the most important part in that regex,
(.)
, is the parentheses though, which captures the.
("any character except newline") and feeds it into$1
.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.pretty basic regex so you should probably read up on them and practice (I suggest eloquent javascript chapter 9).
The . means any character except newlines
You can't just switch out the . for [a-z], you have to do [a-z||A-Z]
This comment is hidden because it contains spoiler information about the solution
I used
[a-z]
in mine as you don't want to.upcase
on non-letters.The letter after the underscore/hyphen matched in the regex.
There are brackets around the full stop, those brackets are what you can reference with
$1
and so on.You mention memory footprint. Is there a way to test how much memory the solution uses?
Is it possible to calculate memory usage and pass the test only if below some level?