+ 3

What should I do to open hidden cases? Allready solved the unhidden (some hidden too).

3rd Jan 2020, 11:46 AM
Karkoran
Karkoran - avatar
5 Antworten
+ 3
Well, you have to test for exactly what they say and nothing else. If cases fail, there's usually a little bug in your solution that will make some inputs come out false.
3rd Jan 2020, 12:27 PM
HonFu
HonFu - avatar
+ 4
You can't. The point probably is to just tailor your code to the specific input. Instead you're supposed to logically figure out what the issue *might* be.
3rd Jan 2020, 11:48 AM
HonFu
HonFu - avatar
+ 4
Let's say you're supposed to add two numbers. You should write a code that does that. The point is, that you take input twice, convert it to actual numbers and add these and output them. Now if you knew what the input of the tests is, you can 'cheat'. If they send 5,7 6,8 4,3, instead of actually coding anything, you could write print(12, 14, 7) and pass the test anyway. So they hide what they send. You have to find a way to win without knowing what exactly is given. Your code has to work in all cases.
3rd Jan 2020, 12:02 PM
HonFu
HonFu - avatar
+ 2
What does it mean to "tailor code to the specific input"? (I'm total beginner). Before i try to put code to the solution I naturally test it in Code Playground.
3rd Jan 2020, 11:57 AM
Karkoran
Karkoran - avatar
+ 1
Does it mean, that for example: in 'argentina' I have to create another condition (else if pesos = dollars * 50) without knowing sololearn wants it? ...because this is quite difficult.
3rd Jan 2020, 12:24 PM
Karkoran
Karkoran - avatar