+ 1

TESTING CASES TROUBLE ( ToT)

I've tried to change time format from 12 hours to 24 hours. After the attempts, my code seems worked but it just thought 3/5 test cases, so I can't gain 50exp as expect. I have no idea... :(( Could someone please help me figure out the shot coming... Thanks... https://code.sololearn.com/cw9ISVn24Tbc/?ref=app

19th Apr 2020, 10:33 AM
Le Hoang Tuan
Le Hoang Tuan - avatar
5 Antworten
+ 1
Your program working fine only for input 1 PM to 11 pm. Input 12:00 AM must return 00:00 For all single digit input hr like 7:00 AM must return 07:00 not 7:00 For 12:00 PM, output should be 12:00 only.. And never use == for string comparisons. It compares refferences not content for strings or objects. Use equals method like t.equals("AM"). //not t=="AM"
19th Apr 2020, 8:08 PM
Jayakrishna 🇮🇳
+ 1
RnT.Lee No. Reverse way... Day starts at 00:00 that is 12:00 AM, 12:00 PM is mid day.. Should return 12:00..
20th Apr 2020, 10:27 AM
Jayakrishna 🇮🇳
0
Jayakrishna🇮🇳 I own you one more. I grateful for your sharing.. It's very helpful for me. :"))
20th Apr 2020, 7:10 AM
Le Hoang Tuan
Le Hoang Tuan - avatar
0
Jayakrishna🇮🇳 Waiting... I think 12:00 PM should be returned is 00:00 and 12:00 AM ->> 12:00. Is it your means?!
20th Apr 2020, 7:20 AM
Le Hoang Tuan
Le Hoang Tuan - avatar
0
Jayakrishna🇮🇳 I'm a little confused... 😅 Because in my culture 00:00 called "mid night". So I've thought it should be 12:00PM. Thanks u, I realized it's wrong.
21st Apr 2020, 12:14 AM
Le Hoang Tuan
Le Hoang Tuan - avatar