Hidden testcase | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hidden testcase

Why in some cases testcases are hidden? Just compare: https://ibb.co/23ZTpTd https://ibb.co/Thqhbmc

7th Aug 2021, 8:15 PM
E A
4 Answers
+ 3
Exactly. As far as I know the app only checks whether or not your code gives the correct output for the input in the test cases. It does not check how your code generates that output. So if you knew what the input in each test case is you could just write a simple code that gives out the correct output. The reason for keeping them hidden even after you passed is probably so you can't tell others what the hidden cases are.
7th Aug 2021, 9:05 PM
Simon Sauter
Simon Sauter - avatar
+ 2
It's so you can't cheat by writing code that works just for the test cases.
7th Aug 2021, 8:25 PM
Simon Sauter
Simon Sauter - avatar
0
Simon, what do you mean exactly? Do you mean cheating in this case is instead to write true code (f.e. print (a+b)& but known answer (for example 5.0),it is just write print(5.0)? What this means in my case - app show me that i reached the test.. What the reason to hide testcase after i reached it?
7th Aug 2021, 8:39 PM
E A
0
Simon, thanks for your answer. Yes, you are right. I tested. App just compare output from user's code with expected output, app not compare codes. It's normal, because different peoples can have different ways/codes to solve task..and "cheat code" it is also one of them. But anyway, as you seen on screenshot or/and you know app never show "expected code", only "expected output" in reached & visible testcases at least. Ritorical question: why app hide testcase for user, who already successfully passed this test? Anticheating as variant isn't strong argument, because it's enough to open CODE tab & share it with another user and he/she also will pass this test.
7th Aug 2021, 9:34 PM
E A