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.
This is the solution that StackOverflow recommends ;-)
really?
what if there will be a List with values {1, -1, 2, -2, 3, -3, 3}?
That may be the gist of the problem, but the problem states 'The string has a length greater or equal to one and contains only letters from a to z.' Adding extra error handling for other symbols and capital letters is not optimal as it's assumed this is already handled before the string is passed in.
Providing invalid characters to the input string is what the problem is all about
Nicely done
good, but you could have renamed the parameters instead. Extra variables add noise to the code, if they are not reused.
I like your clarification of variable names too!
I hadn't concidered Arphox's comment at all (thinking they were givens I couldn't change), but they're right. Unless stipulated in some sort of weird requirement, the parameter names are up to me as well.
Either way, such additions will be removed by optimizations, so adding code like this to benefit readability is always a great idea.
Oh my God! That was so easy...
This comment is hidden because it contains spoiler information about the solution
How many string allocations on heap you have? I see 'n' allocations. I think this is too much for solve this simple task.
This comment is hidden because it contains spoiler information about the solution
hmm forgot this could be done with Linq.
@mvdoyle
Click reset until you see this in sample tests:
Modify the sample test:
Test.expect(solution('world'), 'dlrow')
This comment is hidden because it contains spoiler information about the solution
Loading more items...