We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functiontimeConversion(s:string):string{// Write your code herelet[hour,minutes,seconds]=s.split(':');if(seconds.substring(2)==='PM'){lethourIn24Pattern=Number(hour)+12;if(hourIn24Pattern<24){hour=String(hourIn24Pattern)}}else{if(hour==='12'){hour='00'}}seconds=seconds.slice(0,2);return[hour,minutes,seconds].join(':')}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →