Not able to pass tests 3 & 5 in Military Challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Not able to pass tests 3 & 5 in Military Challenge

I have tested all edge cases that I can think of ensuring correct output appears for AM & PM configurations. Also ensured that single digits are prefixed by 0 & that the output is in string format. All my testing on Sololearn does not show the error. Could some-one help find the bug please, so I may learn from this. https://code.sololearn.com/cp03KfPY0Tn4/?ref=app https://code.sololearn.com/cp03KfPY0Tn4/?ref=app

18th Jul 2021, 6:07 AM
Rik Wittkopp
Rik Wittkopp - avatar
5 Answers
+ 3
NotAPythonNinja 🤣😂🤣😂 So easy! I was sure I had 0, didn't even think I had typed O. Good pick up, well done & many thanks
18th Jul 2021, 7:19 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
Atul [Inactive] That's ok buddy, you must have used the code that was repaired through the assistance of NotAPythonNinja
18th Jul 2021, 7:23 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
NotAPythonNinja That's true, but I am concatenating a string to a string by that stage of the code. string res; "0" + res I will double check, & please correct me if I am wrong.
18th Jul 2021, 7:08 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
@Rik It's working fine. Sorry I tested your code without your permission. And it resulted me with xps
18th Jul 2021, 7:21 AM
Atul [Inactive]
+ 2
Rik Wittkopp I solved it earlier by java so I knew the error ;) . But that 0 and O seemed to trick my eyes 😂
18th Jul 2021, 7:45 AM
Atul [Inactive]