"Military Time" challenge is unsolvable. | Sololearn: Learn to code for FREE!


"Military Time" challenge is unsolvable.

I've solved the military time challenge, where you convert a 12 hour clock time to a 24 hour one. But because of how this horrendous website was made, it asks for the result to be printed instead of returned like sensible websites do. When you try to test a case, it will only work for one since the printed output can't change per case.

4/19/2021 4:59:42 AM


4 Answers

New Answer


Specify the language and show the code too


Possible mistake: Your program should take the input (which is given when testing and which you can see in result), not just a sample input given in a task, and generate input that is based on the given input. About the way SoloLearn wants us to write programs: no matter *how* you wrote your program, the only thing is if the output is correct. The is a big chance that websites that ask to return a value check the *code*, not the *result*, or have a predefined code that outputs/checks the returned value. This is (at least, for me) closer to writing real programs as real projects. Also: if you just return value(s), it is harder to hold multiple values that should be returned, especially if the dynamic output is easier to implement.


Hi! most likely, you are using direct values for the input data. you shouldn't do that. come up with a universal code that will be suitable for many cases, not just one. show your code and help will be more productive


how do I separate the AM in a string and leave the digits with a colon?