+ 6
Some test cases are hidden so that one is not able to simply hard-code answers according to the test case and pass all the test cases.
Try using random inputs and check generality of your approach. Check for corner test cases. You must be going wrong somewhere.
+ 5
The reason for hiding some test cases is to make sure the programer writes the code which should work for every possible values when given correctly ( according to question ) and not for only 5-10 specific cases
Ideally they should not show even a single test case on which your program is being tested on(and this is how it happens in most of the coding competitions), but SL is being libral by showing you at leas one or 2 test cases.
+ 1
Why can't they just use random numbers each time? Surely this would help our test cases we can see and wouldn't be terribly difficult for an app that teaches programing languages. Now I have to figure out how to input a bunch of numbers myself due to the same issue brought up here.
0
I was wondering the same thing. And why can't we see an example of how to solve the problem like a pro would after we have solved it our beginners way? I just solved the problem in C++ "11 Code Project - Transportation", but I did it using a While Loop. "Conditionals and Loops" are covered in the NEXT lesson. (I Googled "C++ while loop" to find out the syntax.) I solved the problem, but clearly did not do it in the way the author of the quiz expects us to. That in itself wouldn't be a concern, except that I can't learn how they expected me to do it, because I can't see their solution. Also, I can't see 3 of the 5 test cases, to get ideas for what to look out for. Surely there would not be any harm in revealing all the test cases AFTER the problem has been solved?! I feel like this opaque teaching method misses some learning opportunities.
- 2
BECAUSE YOUR CODE IS NOT COMPATIBLE TO SOLVE THE QUESTIONS