+ 1

Military time problem solving in two way. Can any one tell me when output will be different.

https://code.sololearn.com/cCAkjZH7X9C7/?ref=app

21st Jun 2020, 7:22 AM
Anik Datta
Anik Datta - avatar
3 Réponses
+ 3
For 1:15 AM it outputs 01:015 which should be 01:15 , For 12:25 AM it outputs 12:25 which should be 00:25 For 12:45 PM it outputs 24:25 instead it should be 12:45 instead
21st Jun 2020, 8:05 AM
Abhay
Abhay - avatar
+ 2
For reliable time converter you would need to rewrite the whole code with better practices. As to my knowledge the 1 hidden test that fail could be either "12:00 PM" or "12:00 AM" Output==> 12:00 and 00:00 respectively. Therefore, you can add extra if/else condition mentioning these two.
21st Jun 2020, 8:18 AM
Valmob101
Valmob101 - avatar
- 1
Abhay Is it possible to implement this code with replace method
21st Jun 2020, 9:04 AM
Anik Datta
Anik Datta - avatar