This code works, but it doesn't fulfill the requirements to get accepted in the Military Time code coach challenge. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

This code works, but it doesn't fulfill the requirements to get accepted in the Military Time code coach challenge.

Does anybody have an idea? I just don,t see the mistake... https://code.sololearn.com/cSZ7KJxCEhoJ/?ref=app

17th Aug 2020, 3:13 PM
Mirko Dreher
Mirko Dreher - avatar
4 Answers
+ 1
Ex: It showing wrong results for sample input 1:00 AM, Your output 1:00, required output 01:00 (for single hr input, append 0) For input 1:00 Pm, Yours 1:00, but required output 13:00
17th Aug 2020, 3:33 PM
Jayakrishna 🇮🇳
+ 1
Know i know my mistake... thought the input would be 01:00 PM but it is 1:00PM. 🤦‍♂️
17th Aug 2020, 3:45 PM
Mirko Dreher
Mirko Dreher - avatar
+ 1
I fixed the issue and i changed the code. Now using a hashmap. But the last condition is still not met. Didnt find it as i was debugging. It shows the time in the format 00:00 now 🤷‍♂️ https://code.sololearn.com/cSRE5r064z9n/?ref=app
17th Aug 2020, 4:38 PM
Mirko Dreher
Mirko Dreher - avatar
+ 1
Ok the third version finally worked. I have to keep things more simple. Thanks everybody. Thread closed... 😊
17th Aug 2020, 5:59 PM
Mirko Dreher
Mirko Dreher - avatar