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.
It'll fail when called several times in a row because the global var will keep its value. Try that in your computer and you'll see it there too.
Everybody who fails says so but they can't test the same tests as at CW. Where you push "attempt" there are lots of tests.
There is no problem in the kata but a problem in your code. Print inputs and your output to see where the problems are. The exception gives you where they can be.
Edit: BTW don't post issue but a question when the number of people passing the kata is high in your language (1060 for C++); in that case chances are that your code is wrong somewhere, otherwise somebody would have spotted it before you. Cheers!
Thank you for helping me. But can you explain me why I cannot use global variable? It does seem to work perfectly fine when I run it in my local computer.
When I tried to attempt the test, it throws a exception what() in stoi (I am using c++). I also tried using stringstream also, but no luck. It works perfectly fine when I test my code. Can someone help me?
That's a problem with your code, are you using a global var?
May be it is problem in random generated string in tests
No, because if I put this string in test sample I have expected result 23
If I run the testcase individually, I pass the testcase. But when I run it collectively, it is failing.