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.
Why are you taking the sign after mod? Mod shouldn't change sign or am I crazy?
To reiterate the last few comments, although now with the added issue tag.
I have written code that past the tests, when it went off to the test suite, it came back with an error and 0 Passed, 0 Failed. The code was converted into JS and that code was able to pass the JS testing. The code was turned back into C++ from JS and the code failed again, with the same problem.
I couldn't help but try and do this, sorry to anyone who has to scroll past this...
I've just ran successful JS code by taking the C++ code and turning it into JS by hand, and it worked without a hitch, then to double check I turned my JS code back into C++ code and it still gave the same issue with Passed: 0, Failed: 0.
The C++ version of this Kata must be bugged some how.
This comment is hidden because it contains spoiler information about the solution
So my C++ code works perfectly on all the test cases and I'm completely certian that it works, for some reason though when I submit the solution code wars gives me an "undefined error".
I'm haven't the faintest idea on how to make it work, but I'll post the code bellow.
There would be no way to determine that a operator was unary in the postfix notation, so it wouldn't make sense to allow for them unless you remove all the unary
+
and turn-x
into0x-
.I actually wrote it out using sumation notation and then simplified down.