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.
OP: posts unformatted code
Also OP: " Everything is written very clearly"
See this paragraph for info how to post your code very clearly.
Ah, okay, I figured out what is going on.
The expectation is correct. Please, check how the
doTest
function works, you have its definition on your hands.So, kata is okay, your code is at fault.
Hint: There's probably a few reasons folks say not to use global scoped variables in your code. You just managed to hit one of these reasons.
Hint 2: this
It's impossible to figure out what your code is, use markdown to paste your code
Your function has a bug, it returns wrong results when it's called more than once. Try following test cases:
Run both tests one after another, and you will the that the first one passes, and the second one fails.
Because your code gives a wrong answer. For the input "ZTK AUWyK Dy HqV" it should return "ZtK AuWyK Dy HqV", but returns "zTk AuWyK Dy HqV" (the first letter must be uppercase).
Not an issue.