Ad
  • Custom User Avatar

    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.

  • Default User Avatar

    It works perfectly fine when I test my code

    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!

  • Custom User Avatar

    That's a problem with your code, are you using a global var?

    C++ Completions 2845