This comment is hidden because it contains spoiler information about the solution
Could you please explain why is that?
Call to .ToCharArray() is unnecessary.
OK, I used a stack to solve the question, but this is much better since it requires only O(1) of extra space! Kudos!
I like the use of Func, makes the whole thing really concise. The only thing I don't like about this, is that you iterate through each array twice, where once would suffice.
I am trying to come up with a way to do that using "getMinMaxLength Func>", where you find the min and max in one iteration. I am not yet familiar enough with lambdas in C# to get it right without thinking longer about it. Do you know how?
Normally I don't like to do these kind of public shaming sessions, but sometimes it just has to be done.
Please learn to write proper and clean code and don't cause hassles to everyone else by writing faulty translations.
Ruby: The actual code limit is 4 lines, not 3.
Also the test used to require that the cards are in order.
I decided to release this requirement. It shouldn't affect the solution approach anyways.
Description is also horrible, which I've fixed (and properly applied the language-if blocks).
What are wrong in the tests:
I cleaned up the tests in all languages and added a basic test in the sample tests.
I also cleaned up the JS test fixture. That was a horribly ugly piece of code. Whoever wrote that should be ashamed of himself.
There are too many things wrong in the translations that I'm not going to write them out before fixing them.
So I'm going to fix them one by one as I write them out in the replies.