July 4, 2022, 9:09 a.m. | foroogh varmazyar

DEV Community dev.to




problem


Given a time in 12-hour AM/PM format, convert it to military (24-hour) time.

Note: - 12:00:00AM on a 12-hour clock is 00:00:00 on a 24-hour clock.

-12:00:00PM on a 12-hour clock is 12:00:00 on a 24-hour clock.





Example



  • s = '12:01:00PM'

    Return '12:01:00'.


  • s= '12:01:00AM'

    Return '00:01:00'.






Function Description


Complete the timeConversion function in the editor below. It should return a new string representing the input time in 24 hour format.


timeConversion has the following parameter(s):



  • string s: …

hackerrank kotlin solution

SOC 2 Manager, Audit and Certification

@ Deloitte | US and CA Multiple Locations

Cyber Security Cloud Solution Architect

@ Microsoft | London, London, United Kingdom

Compliance Program Analyst

@ SailPoint | United States

Software Engineer III, Infrastructure, Google Cloud Security and Privacy

@ Google | Sunnyvale, CA, USA

Cryptography Expert

@ Raiffeisen Bank Ukraine | Kyiv, Kyiv city, Ukraine

Senior Cyber Intelligence Planner (15.09)

@ OCT Consulting, LLC | Washington, District of Columbia, United States