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.
Approved
In the end of the secription it says that your program is not allowed to access its own source code.
So such things are not accessible.
approved
duplicate issue
I don't know why this was downvoted. The description doesn't say anything about per-test time limits nor is it specified anywhere what these limits should be. This information should be in the description.
Why it matters: Knowing whether your code is a few milliseconds off or an order of magnitude off affects your approach on solving the problem. Imagine if the time requirement was 240 microseconds. Then the solution might just be to modify a conditional or include a called function's code directly in your main function. Now imagine if the time requirement was 10 microseconds: You'd be pretty sure your entire approach should be questioned.
For anyone looking for what time they need to get it to pass, the slowest run of my passing solution was around 90 ms for the batch. Guessing the cut-off is 100?
approved
^ this this this this this. Also, if the Kata is about performance, I'd advise explicitly saying so.
I agree, this exercise looks like it was made by some JAVA fanboi. They always seem to have a chip on their shoulder with regards to anyone who hasn't finished 4-5 years studying it at University. Everyone else is not a "real" programmer.
Thanks for pointing out the obvious issues I missed. Just fixed them.
LGTM. Approved
I guess I already explained it up there, 2 / 3 with integer division is 0, 9 * 4 is 36.
How are you even getting 36 from that?
Closing, because the test is fine.
See the last example:
I'd say that's a similar case. I'm tempted to close this issue, because the test is fine, and your post says it's not. Maybe ask for clarification or suggest better examples.
What you did is inserting the operators between the operands and went from left to right, that's wrong, and that's how you got 36:
((2 / 3) + 9) * 4
.That, in posfix notation would be:
2 3 / 9 + 4 *
Isn't it like this?
2 * (3 + (9 / 4)) = 10
Loading more items...